schema
stringlengths 28
5.65k
| question
stringlengths 0
990
| rejected
stringlengths 2
4.44k
| chosen
stringlengths 4
9.17k
| weight
float64 0
8.95
|
---|---|---|---|---|
CREATE TABLE table_1341453_45 (district VARCHAR, incumbent VARCHAR)
| What district is nick lampson from? | SELECT district FROM table_1341453_45 WHERE incumbent = "Nick Lampson" | SELECT "district" FROM "table_1341453_45" WHERE "Nick Lampson" = "incumbent" | 0.074219 |
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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
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)
| Math users (main + meta). | SELECT 'https://stackoverflow.com/u/' + CAST(Main.Id AS TEXT) + '|' + Main.DisplayName, Main.Reputation, Main.Total AS "# of posts (main)", Meta.Total AS "# of posts (meta)", CASE WHEN Meta.Total = 0 THEN NULL ELSE ROUND(CAST(Main.Total AS FLOAT) / Meta.Total, 2) END AS "Ratio" FROM (SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS Total FROM "stackoverflow".dbo.Users AS u INNER JOIN "stackoverflow".dbo.Posts AS p ON u.Id = p.OwnerUserId GROUP BY u.Id, u.DisplayName, u.Reputation) AS Main INNER JOIN (SELECT u.Id, COUNT(*) AS Total FROM "stackoverflow.meta".dbo.Users AS u INNER JOIN "stackoverflow.meta".dbo.Posts AS p ON u.Id = p.OwnerUserId GROUP BY u.Id) AS Meta ON Main.Id = Meta.Id ORDER BY Main.Reputation DESC | WITH "Main" AS (SELECT "u"."Id", "u"."DisplayName", "u"."Reputation", COUNT(*) AS "Total" FROM "stackoverflow"."dbo"."Users" AS "u" JOIN "stackoverflow"."dbo"."Posts" AS "p" ON "p"."OwnerUserId" = "u"."Id" GROUP BY "u"."Id", "u"."DisplayName", "u"."Reputation"), "Meta" AS (SELECT "u"."Id", COUNT(*) AS "Total" FROM "stackoverflow.meta"."dbo"."Users" AS "u" JOIN "stackoverflow.meta"."dbo"."Posts" AS "p" ON "p"."OwnerUserId" = "u"."Id" GROUP BY "u"."Id") SELECT CONCAT(CONCAT('https://stackoverflow.com/u/', CAST("Main"."Id" AS TEXT)), '|') + "Main"."DisplayName", "Main"."Reputation", "Main"."Total" AS "# of posts (main)", "Meta"."Total" AS "# of posts (meta)", CASE WHEN "Meta"."Total" = 0 THEN NULL ELSE ROUND(CAST("Main"."Total" AS FLOAT) / NULLIF("Meta"."Total", 0), 2) END AS "Ratio" FROM "Main" AS "Main" JOIN "Meta" AS "Meta" ON "Main"."Id" = "Meta"."Id" ORDER BY "Main"."Reputation" DESC NULLS LAST | 0.887695 |
CREATE TABLE table_79987 ("Outcome" TEXT, "Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Opponent" TEXT, "Score" TEXT)
| Where was the tournament played on Oct. 8, 2006? | SELECT "Tournament" FROM table_79987 WHERE "Date" = 'oct. 8, 2006' | SELECT "Tournament" FROM "table_79987" WHERE "Date" = 'oct. 8, 2006' | 0.066406 |
CREATE TABLE Marketing_Regions (Marketing_Region_Code CHAR, Marketing_Region_Name VARCHAR, Marketing_Region_Descriptrion VARCHAR, Other_Details VARCHAR)
CREATE TABLE Bookings_Services (Order_ID INT, Product_ID INT)
CREATE TABLE Bookings (Booking_ID INT, Customer_ID INT, Workshop_Group_ID VARCHAR, Status_Code CHAR, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR)
CREATE TABLE Addresses (Address_ID VARCHAR, Line_1 VARCHAR, Line_2 VARCHAR, City_Town VARCHAR, State_County VARCHAR, Other_Details VARCHAR)
CREATE TABLE Customers (Customer_ID VARCHAR, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Products (Product_ID VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Product_Description VARCHAR, Other_Product_Service_Details VARCHAR)
CREATE TABLE Performers (Performer_ID INT, Address_ID INT, Customer_Name VARCHAR, Customer_Phone VARCHAR, Customer_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Invoices (Invoice_ID INT, Order_ID INT, payment_method_code CHAR, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR, Order_Item_ID INT)
CREATE TABLE Performers_in_Bookings (Order_ID INT, Performer_ID INT)
CREATE TABLE Invoice_Items (Invoice_Item_ID INT, Invoice_ID INT, Order_ID INT, Order_Item_ID INT, Product_ID INT, Order_Quantity INT, Other_Item_Details VARCHAR)
CREATE TABLE Services (Service_ID INT, Service_Type_Code CHAR, Workshop_Group_ID INT, Product_Description VARCHAR, Product_Name VARCHAR, Product_Price DECIMAL, Other_Product_Service_Details VARCHAR)
CREATE TABLE Ref_Service_Types (Service_Type_Code CHAR, Parent_Service_Type_Code CHAR, Service_Type_Description VARCHAR)
CREATE TABLE Stores (Store_ID VARCHAR, Address_ID INT, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Ref_Payment_Methods (payment_method_code CHAR, payment_method_description VARCHAR)
CREATE TABLE Drama_Workshop_Groups (Workshop_Group_ID INT, Address_ID INT, Currency_Code CHAR, Marketing_Region_Code CHAR, Store_Name VARCHAR, Store_Phone VARCHAR, Store_Email_Address VARCHAR, Other_Details VARCHAR)
CREATE TABLE Order_Items (Order_Item_ID INT, Order_ID INT, Product_ID INT, Order_Quantity VARCHAR, Other_Item_Details VARCHAR)
CREATE TABLE Customer_Orders (Order_ID INT, Customer_ID INT, Store_ID INT, Order_Date DATETIME, Planned_Delivery_Date DATETIME, Actual_Delivery_Date DATETIME, Other_Order_Details VARCHAR)
CREATE TABLE Clients (Client_ID INT, Address_ID INT, Customer_Email_Address VARCHAR, Customer_Name VARCHAR, Customer_Phone VARCHAR, Other_Details VARCHAR)
| Show all the planned delivery dates and bin by year in a line chart, and rank from high to low by the X-axis. | SELECT Planned_Delivery_Date, COUNT(Planned_Delivery_Date) FROM Bookings ORDER BY Planned_Delivery_Date DESC | SELECT "Planned_Delivery_Date", COUNT("Planned_Delivery_Date") FROM "Bookings" ORDER BY "Planned_Delivery_Date" DESC NULLS LAST | 0.124023 |
CREATE TABLE captain (Captain_ID INT, Name TEXT, Ship_ID INT, age TEXT, Class TEXT, Rank TEXT)
CREATE TABLE Ship (Ship_ID INT, Name TEXT, Type TEXT, Built_Year FLOAT, Class TEXT, Flag TEXT)
| For those ships that do not have a captain, tell me the total number of their classes using a pie chart, display from low to high by the bars please. | SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class ORDER BY Class | SELECT "Class", COUNT("Class") FROM "Ship" WHERE NOT "Ship_ID" IN (SELECT "Ship_ID" FROM "captain") GROUP BY "Class" ORDER BY "Class" NULLS FIRST | 0.141602 |
CREATE TABLE procedures (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 diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
| How many patients have stayed in the hospital for more than 6 days and had a lab test uptake ratio? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "6" AND lab.label = "Uptake Ratio" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "lab" ON "Uptake Ratio" = "lab"."label" AND "demographic"."hadm_id" = "lab"."hadm_id" WHERE "6" < "demographic"."days_stay" | 0.192383 |
CREATE TABLE table_name_12 (region VARCHAR)
| What is the average value for 1970, when the Region is East Europe (7 Economies), and when 2000 has a value greater than 2? | SELECT AVG(1970) FROM table_name_12 WHERE region = "east europe (7 economies)" AND 2000 > 2 | SELECT AVG(1970) FROM "table_name_12" WHERE "east europe (7 economies)" = "region" | 0.080078 |
CREATE TABLE table_7376 ("Cartridge" TEXT, "Bullet weight" TEXT, "Muzzle velocity" TEXT, "Muzzle energy" TEXT, "Source" TEXT)
| What is Muzzle energy, when Source is hornady? | SELECT "Muzzle energy" FROM table_7376 WHERE "Source" = 'hornady' | SELECT "Muzzle energy" FROM "table_7376" WHERE "Source" = 'hornady' | 0.06543 |
CREATE TABLE park (state VARCHAR)
| List the names of states that have more than 2 parks. | SELECT state FROM park GROUP BY state HAVING COUNT(*) > 2 | SELECT "state" FROM "park" GROUP BY "state" HAVING COUNT(*) > 2 | 0.061523 |
CREATE TABLE table_name_3 (player VARCHAR, country VARCHAR)
| Which player is from Sweden? | SELECT player FROM table_name_3 WHERE country = "sweden" | SELECT "player" FROM "table_name_3" WHERE "country" = "sweden" | 0.060547 |
CREATE TABLE table_76867 ("Game" FLOAT, "Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Location" TEXT, "Attendance" FLOAT, "Record" TEXT, "Points" FLOAT)
| What game has a 6-12-8 record? | SELECT "Game" FROM table_76867 WHERE "Record" = '6-12-8' | SELECT "Game" FROM "table_76867" WHERE "Record" = '6-12-8' | 0.056641 |
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
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 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 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 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_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_procedures (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 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| what are the five most frequently prescribed drugs for patients 20s this year? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."age" <= 29 AND "admissions"."age" >= 20 GROUP BY "hadm_id"), "t1" AS (SELECT "prescriptions"."drug", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "prescriptions" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "prescriptions"."hadm_id" WHERE DATETIME("prescriptions"."startdate", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_0"."" IS NULL GROUP BY "prescriptions"."drug") SELECT "t1"."drug" FROM "t1" AS "t1" WHERE "t1"."c1" <= 5 | 0.554688 |
CREATE TABLE Customer_Event_Notes (Customer_Event_ID VARCHAR)
CREATE TABLE Customer_Events (Customer_Event_ID VARCHAR, property_id VARCHAR, customer_event_id VARCHAR)
| Which events have the number of notes between one and three? List the event id and the property id. | SELECT T1.Customer_Event_ID, T1.property_id FROM Customer_Events AS T1 JOIN Customer_Event_Notes AS T2 ON T1.Customer_Event_ID = T2.Customer_Event_ID GROUP BY T1.Customer_Event_ID HAVING COUNT(*) BETWEEN 1 AND 3 | SELECT "T1"."Customer_Event_ID", "T1"."property_id" FROM "Customer_Events" AS "T1" JOIN "Customer_Event_Notes" AS "T2" ON "T1"."Customer_Event_ID" = "T2"."Customer_Event_ID" GROUP BY "T1"."Customer_Event_ID" HAVING COUNT(*) <= 3 AND COUNT(*) >= 1 | 0.240234 |
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
| For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of revenue , and group by attribute name, display in desc by the the average of revenue. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Revenue DESC | SELECT "T2"."Name", "T2"."Revenue" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T2"."Name" ORDER BY "T2"."Revenue" DESC NULLS LAST | 0.180664 |
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 offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE 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 requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE 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_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 instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE 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_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req 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)
| IS LING 997 a course offered during the next semester ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LING' AND course.number = 997 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | SELECT COUNT(*) > 0 FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'FA' AND "semester"."year" = 2016 WHERE "course"."department" = 'LING' AND "course"."number" = 997 | 0.306641 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients are with admission type urgent and have primary disease mesentric ischemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "MESENTERIC ISCHEMIA" = "demographic"."diagnosis" AND "URGENT" = "demographic"."admission_type" | 0.166016 |
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 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)
| get me the number of patients born before 2107 who have coronary artery primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE" AND demographic.dob_year < "2107" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2107" > "demographic"."dob_year" AND "CORONARY ARTERY DISEASE" = "demographic"."diagnosis" | 0.162109 |
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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| what are the four most commonly ordered lab tests for patients who had previously been diagnosed with hepatic trauma - grade i laceration during the same month, since 2105? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatic trauma - grade i laceration' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105') AS t1 JOIN (SELECT patient.uniquepid, lab.labname, lab.labresulttime FROM lab JOIN patient ON lab.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', lab.labresulttime) >= '2105') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.labresulttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.labresulttime, 'start of month') GROUP BY t2.labname) AS t3 WHERE t3.c1 <= 4 | WITH "t2" AS (SELECT "patient"."uniquepid", "lab"."labname", "lab"."labresulttime" FROM "lab" JOIN "patient" ON "lab"."patientunitstayid" = "patient"."patientunitstayid" WHERE STRFTIME('%y', "lab"."labresulttime") >= '2105'), "t3" AS (SELECT "t2"."labname", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" AS "t2" ON "diagnosis"."diagnosistime" < "t2"."labresulttime" AND "patient"."uniquepid" = "t2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("t2"."labresulttime", 'start of month') WHERE "diagnosis"."diagnosisname" = 'hepatic trauma - grade i laceration' AND STRFTIME('%y', "diagnosis"."diagnosistime") >= '2105' GROUP BY "t2"."labname") SELECT "t3"."labname" FROM "t3" AS "t3" WHERE "t3"."c1" <= 4 | 0.84375 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is diagnoses long title and procedure long title of subject id 92796? | SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "92796" | SELECT "diagnoses"."long_title", "procedures"."long_title" FROM "diagnoses" JOIN "procedures" ON "diagnoses"."hadm_id" = "procedures"."hadm_id" WHERE "92796" = "diagnoses"."subject_id" | 0.179688 |
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_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE 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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
| what is the three, the most frequent input event in 2102? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3) | WITH "t1" AS (SELECT "inputevents_cv"."itemid", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "inputevents_cv" WHERE STRFTIME('%y', "inputevents_cv"."charttime") = '2102' GROUP BY "inputevents_cv"."itemid"), "_u_0" AS (SELECT "t1"."itemid" FROM "t1" AS "t1" WHERE "t1"."c1" <= 3 GROUP BY "itemid") SELECT "d_items"."label" FROM "d_items" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "d_items"."itemid" WHERE NOT "_u_0"."" IS NULL | 0.436523 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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)
| find me the number of unmarried patients who have 4523 procedure icd9 code. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.icd9_code = "4523" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "4523" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "SINGLE" = "demographic"."marital_status" | 0.21875 |
CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT)
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT)
CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT)
| Return a bar chart about the distribution of meter_200 and the average of ID , and group by attribute meter_200, and I want to order y-axis in desc order. | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) DESC | SELECT "meter_200", AVG("ID") FROM "swimmer" GROUP BY "meter_200" ORDER BY AVG("ID") DESC NULLS LAST | 0.097656 |
CREATE TABLE table_name_22 (week VARCHAR, date VARCHAR, attendance VARCHAR)
| How many Weeks are on september 8, 1980 and Attendances larger than 55,045? Question 4 | SELECT COUNT(week) FROM table_name_22 WHERE date = "september 8, 1980" AND attendance > 55 OFFSET 045 | SELECT COUNT("week") FROM "table_name_22" WHERE "attendance" > 55 AND "date" = "september 8, 1980" OFFSET 045 | 0.106445 |
CREATE TABLE table_dev_4 ("id" INT, "hypothyroidism" BOOLEAN, "serum_bicarbonate" INT, "c_peptide_level" FLOAT, "autoimmune_disease" BOOLEAN, "hemoglobin_a1c_hba1c" FLOAT, "positive_serum" BOOLEAN, "inhaled_steroids" BOOLEAN, "diabetic_ketoacidosis" BOOLEAN, "creatinine_clearance_cl" FLOAT, "urinary_ketones" BOOLEAN, "admission_blood_glucose" INT, "chronic_inflammatory" BOOLEAN, "asthma" BOOLEAN, "NOUSE" FLOAT)
| c _ peptide < 1 ng / ml; | SELECT * FROM table_dev_4 WHERE c_peptide_level < 1 | SELECT * FROM "table_dev_4" WHERE "c_peptide_level" < 1 | 0.053711 |
CREATE TABLE table_19714 ("Rank" FLOAT, "Name" TEXT, "Nationality" TEXT, "Total points" TEXT, "Oberstdorf ( Rk ) " TEXT, "Ga-Pa ( Rk ) " TEXT, "Bhofen#1 ( Rk ) " TEXT, "Bhofen#2 ( Rk ) " TEXT)
| What was the Bhofen #1 score and rank for the player whose Bhofen #2 score and rank was 231.2 (8)? | SELECT "Bhofen#1 (Rk)" FROM table_19714 WHERE "Bhofen#2 (Rk)" = '231.2 (8)' | SELECT "Bhofen#1 (Rk)" FROM "table_19714" WHERE "Bhofen#2 (Rk)" = '231.2 (8)' | 0.075195 |
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
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 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 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount 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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 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 d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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)
| what is the average yearly number of patients that are suffering from gastrostomy comp - mech? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'gastrostomy comp - mech') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1 | WITH "t1" AS (SELECT COUNT(DISTINCT "diagnoses_icd"."hadm_id") AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'gastrostomy comp - mech' GROUP BY STRFTIME('%y', "diagnoses_icd"."charttime")) SELECT AVG("t1"."c1") FROM "t1" AS "t1" | 0.327148 |
CREATE TABLE table_21676617_1 (odds_of_winner VARCHAR, horse VARCHAR)
| What were Gentleman's odds of winner? | SELECT odds_of_winner FROM table_21676617_1 WHERE horse = "Gentleman" | SELECT "odds_of_winner" FROM "table_21676617_1" WHERE "Gentleman" = "horse" | 0.073242 |
CREATE TABLE table_40028 ("Position" TEXT, "Jersey #" FLOAT, "Name" TEXT, "Height ( cm ) " FLOAT, "Weight ( kg ) " FLOAT, "Birthdate" TEXT, "Birthplace" TEXT, "2009\\u20132010 Team" TEXT)
| What is the birthplace of the player who played for the Calgary Flames between 2009-2010 and wears a jersey number greater than 23? | SELECT "Birthplace" FROM table_40028 WHERE "2009\u20132010 Team" = 'calgary flames' AND "Jersey #" > '23' | SELECT "Birthplace" FROM "table_40028" WHERE "2009\u20132010 Team" = 'calgary flames' AND "Jersey #" > '23' | 0.104492 |
CREATE TABLE table_name_36 (opponent VARCHAR, venue VARCHAR)
| Which team did the Boston Beaneaters host at the South End Grounds? | SELECT opponent FROM table_name_36 WHERE venue = "south end grounds" | SELECT "opponent" FROM "table_name_36" WHERE "south end grounds" = "venue" | 0.072266 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many of the patients treated with drug code docu100l have an unspecified death status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.formulary_drug_cd = "DOCU100L" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "DOCU100L" = "prescriptions"."formulary_drug_cd" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "0" = "demographic"."expire_flag" | 0.231445 |
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)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| what is the date of birth and gender of Jerry Deberry? | SELECT demographic.dob, demographic.gender FROM demographic WHERE demographic.name = "Jerry Deberry" | SELECT "demographic"."dob", "demographic"."gender" FROM "demographic" WHERE "Jerry Deberry" = "demographic"."name" | 0.111328 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
| patient 004-29334 was allergic to a drug during this month, what was the name of the drug? | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-29334')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '004-29334' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT "allergy"."drugname" FROM "allergy" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE DATETIME("allergy"."allergytime", 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT "_u_1"."" IS NULL | 0.598633 |
CREATE TABLE table_name_67 (title VARCHAR, share VARCHAR)
| Which title has a share of 19,9% | SELECT title FROM table_name_67 WHERE share = "19,9%" | SELECT "title" FROM "table_name_67" WHERE "19,9%" = "share" | 0.057617 |
CREATE TABLE table_name_77 (date VARCHAR, score VARCHAR)
| What's the date when the score was 690.3? | SELECT date FROM table_name_77 WHERE score = "690.3" | SELECT "date" FROM "table_name_77" WHERE "690.3" = "score" | 0.056641 |
CREATE TABLE table_51137 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is Country, when Score is 71-74-70=215? | SELECT "Country" FROM table_51137 WHERE "Score" = '71-74-70=215' | SELECT "Country" FROM "table_51137" WHERE "Score" = '71-74-70=215' | 0.064453 |
CREATE TABLE table_name_90 (date VARCHAR, game_site VARCHAR)
| When did the Texans play at LP Field? | SELECT date FROM table_name_90 WHERE game_site = "lp field" | SELECT "date" FROM "table_name_90" WHERE "game_site" = "lp field" | 0.063477 |
CREATE TABLE table_77425 ("Year" FLOAT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "Team" TEXT)
| What's the nationality of Montreal Impact with Justin Mapp Category:articles with hcards as the player? | SELECT "Nationality" FROM table_77425 WHERE "Team" = 'montreal impact' AND "Player" = 'justin mapp category:articles with hcards' | SELECT "Nationality" FROM "table_77425" WHERE "Player" = 'justin mapp category:articles with hcards' AND "Team" = 'montreal impact' | 0.12793 |
CREATE TABLE table_6672 ("Mission" TEXT, "Resident Country" TEXT, "Local Location" TEXT, "Local Mission" TEXT, "Local Position" TEXT)
| What is the local location that has senegal as the resident county, and a mission of mali? | SELECT "Local Location" FROM table_6672 WHERE "Resident Country" = 'senegal' AND "Mission" = 'mali' | SELECT "Local Location" FROM "table_6672" WHERE "Mission" = 'mali' AND "Resident Country" = 'senegal' | 0.098633 |
CREATE TABLE table_44807 ("Year" FLOAT, "Network" TEXT, "Play-by-play" TEXT, "Color commentator ( s ) " TEXT, "Pregame host" TEXT)
| What is the name of the pregame host when the Play-by-play was by JP Dellacamera, earlier than 2009, and Color commentator(s) was Ty Keough? | SELECT "Pregame host" FROM table_44807 WHERE "Play-by-play" = 'jp dellacamera' AND "Year" < '2009' AND "Color commentator(s)" = 'ty keough' | SELECT "Pregame host" FROM "table_44807" WHERE "Color commentator(s)" = 'ty keough' AND "Play-by-play" = 'jp dellacamera' AND "Year" < '2009' | 0.137695 |
CREATE TABLE Sportsinfo (StuID VARCHAR, onscholarship VARCHAR)
| List ids for all student who are on scholarship. | SELECT StuID FROM Sportsinfo WHERE onscholarship = 'Y' | SELECT "StuID" FROM "Sportsinfo" WHERE "onscholarship" = 'Y' | 0.058594 |
CREATE TABLE table_name_56 (to_par VARCHAR, finish VARCHAR, player VARCHAR)
| What is the To Par when the finish was t16 and the player was Julius Boros? | SELECT to_par FROM table_name_56 WHERE finish = "t16" AND player = "julius boros" | SELECT "to_par" FROM "table_name_56" WHERE "finish" = "t16" AND "julius boros" = "player" | 0.086914 |
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 Premises (premise_id INT, premises_type VARCHAR, premise_details VARCHAR)
CREATE TABLE Mailshot_Customers (mailshot_id INT, customer_id INT, outcome_code VARCHAR, mailshot_customer_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)
CREATE TABLE Mailshot_Campaigns (mailshot_id INT, product_category VARCHAR, mailshot_name VARCHAR, mailshot_start_date DATETIME, mailshot_end_date DATETIME)
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 Products (product_id INT, product_category VARCHAR, product_name VARCHAR)
| Show each premise type and the number of premises in that type Visualize by bar chart, and show by the Y in ascending please. | SELECT premises_type, COUNT(*) FROM Premises GROUP BY premises_type ORDER BY COUNT(*) | SELECT "premises_type", COUNT(*) FROM "Premises" GROUP BY "premises_type" ORDER BY COUNT(*) NULLS FIRST | 0.100586 |
CREATE TABLE table_48908 ("Episode #" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Originalairdate" TEXT)
| What is Directed By, when Episode # is 7? | SELECT "Directed by" FROM table_48908 WHERE "Episode #" = '7' | SELECT "Directed by" FROM "table_48908" WHERE "Episode #" = '7' | 0.061523 |
CREATE TABLE table_51003 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" FLOAT)
| In which week was the game played on October 12, 1975 and the crowd was larger than 44,043? | SELECT COUNT("Week") FROM table_51003 WHERE "Date" = 'october 12, 1975' AND "Attendance" > '44,043' | SELECT COUNT("Week") FROM "table_51003" WHERE "Attendance" > '44,043' AND "Date" = 'october 12, 1975' | 0.098633 |
CREATE TABLE pilot (Name VARCHAR, Age VARCHAR)
| What are the name of pilots aged 25 or older? | SELECT Name FROM pilot WHERE Age >= 25 | SELECT "Name" FROM "pilot" WHERE "Age" >= 25 | 0.042969 |
CREATE TABLE table_12784134_24 (future_stem VARCHAR, perfect_stem VARCHAR)
| What is the number for future stem for poztu? | SELECT COUNT(future_stem) FROM table_12784134_24 WHERE perfect_stem = "poztu" | SELECT COUNT("future_stem") FROM "table_12784134_24" WHERE "perfect_stem" = "poztu" | 0.081055 |
CREATE TABLE table_204_139 (id DECIMAL, "community" TEXT, "airport name" TEXT, "type" TEXT, "coordinates" TEXT)
| how many airports are there in the townsville community ? | SELECT COUNT("airport name") FROM table_204_139 WHERE "community" = 'townsville' | SELECT COUNT("airport name") FROM "table_204_139" WHERE "community" = 'townsville' | 0.080078 |
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
| For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the email , and rank x-axis in asc order. | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | SELECT "EMAIL", "DEPARTMENT_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "EMAIL" NULLS FIRST | 0.195313 |
CREATE TABLE table_name_2 (name VARCHAR, time VARCHAR)
| Tell me the name for time of 25.74 | SELECT name FROM table_name_2 WHERE time = 25.74 | SELECT "name" FROM "table_name_2" WHERE "time" = 25.74 | 0.052734 |
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 outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE 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 microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label 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 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 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 diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
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 labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
| what intake did patient 25951 have the last time on 06/15/this year. | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 25951)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', inputevents_cv.charttime) = '06-15' ORDER BY inputevents_cv.charttime DESC LIMIT 1) | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25951 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 "d_items"."label" FROM "d_items" WHERE "d_items"."itemid" IN (SELECT "inputevents_cv"."itemid" FROM "inputevents_cv" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "inputevents_cv"."icustay_id" WHERE DATETIME("inputevents_cv"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m-%d', "inputevents_cv"."charttime") = '06-15' ORDER BY "inputevents_cv"."charttime" DESC NULLS LAST LIMIT 1) | 0.742188 |
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
| whats the last height of patient 011-31229 since 08/2105? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-31229') AND NOT patient.admissionheight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) >= '2105-08' ORDER BY patient.unitadmittime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '011-31229' GROUP BY "patienthealthsystemstayid") SELECT "patient"."admissionheight" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL AND NOT "patient"."admissionheight" IS NULL AND STRFTIME('%y-%m', "patient"."unitadmittime") >= '2105-08' ORDER BY "patient"."unitadmittime" DESC NULLS LAST LIMIT 1 | 0.466797 |
CREATE TABLE representative (Representative_ID INT, Name TEXT, State TEXT, Party TEXT, Lifespan TEXT)
CREATE TABLE election (Election_ID INT, Representative_ID INT, Date TEXT, Votes FLOAT, Vote_Percent FLOAT, Seats FLOAT, Place FLOAT)
| List the dates and vote percents of elections by a pie chart. | SELECT Date, Vote_Percent FROM election | SELECT "Date", "Vote_Percent" FROM "election" | 0.043945 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE 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 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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| how many arteriovenous shunt for renal dialysis procedures were completed? | SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'arteriovenous shunt for renal dialysis' | SELECT COUNT(*) FROM "treatment" WHERE "treatment"."treatmentname" = 'arteriovenous shunt for renal dialysis' | 0.106445 |
CREATE TABLE table_27153 ("Rnd." FLOAT, "Circuit" TEXT, "LMP1 Winning Team" TEXT, "LMP2 Winning Team" TEXT, "FLM Winning Team" TEXT, "GT1 Winning Team" TEXT, "GT2 Winning Team" TEXT, "Results" TEXT)
| In what round did Mike Newton Thomas Erdos Ben Collins won the LMP2? | SELECT "Rnd." FROM table_27153 WHERE "LMP2 Winning Team" = 'Mike Newton Thomas Erdos Ben Collins' | SELECT "Rnd." FROM "table_27153" WHERE "LMP2 Winning Team" = 'Mike Newton Thomas Erdos Ben Collins' | 0.09668 |
CREATE TABLE table_203_353 (id DECIMAL, "#" DECIMAL, "title" TEXT, "producer ( s ) " TEXT, "featured guest ( s ) " TEXT, "time" TEXT)
| how long is die slow in terms of time ? | SELECT "time" FROM table_203_353 WHERE "title" = '"die slow"' | SELECT "time" FROM "table_203_353" WHERE "title" = '"die slow"' | 0.061523 |
CREATE TABLE table_203_603 (id DECIMAL, "service" TEXT, "service id" TEXT, "bit rate" TEXT, "audio channels" TEXT, "description" TEXT, "analogue availability" TEXT)
| what is the number of christian radio stations broadcasted by mxr yorkshire ? | SELECT COUNT(*) FROM table_203_603 WHERE "description" = 'christian' | SELECT COUNT(*) FROM "table_203_603" WHERE "description" = 'christian' | 0.068359 |
CREATE TABLE table_name_49 (races INT, points VARCHAR)
| WHAT IS THE SUM OF RACES WITH 9 POINTS? | SELECT SUM(races) FROM table_name_49 WHERE points = "9" | SELECT SUM("races") FROM "table_name_49" WHERE "9" = "points" | 0.05957 |
CREATE TABLE table_59833 ("Date" TEXT, "Round" TEXT, "Opponent" TEXT, "Venue" TEXT, "Result" TEXT, "Attendance" FLOAT)
| What is the round for the opponent CSKA Sofia in Venue A? | SELECT "Round" FROM table_59833 WHERE "Opponent" = 'cska sofia' AND "Venue" = 'a' | SELECT "Round" FROM "table_59833" WHERE "Opponent" = 'cska sofia' AND "Venue" = 'a' | 0.081055 |
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)
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)
| give me the number of patients whose insurance is self pay and diagnoses long title is lumbago? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.long_title = "Lumbago" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Lumbago" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "Self Pay" = "demographic"."insurance" | 0.216797 |
CREATE TABLE table_name_34 (manufacturer VARCHAR, wheel_arrangement VARCHAR, class VARCHAR)
| What manufacturer has a wheel arrangement of 4-6-6-4, and a Class of z-7? | SELECT manufacturer FROM table_name_34 WHERE wheel_arrangement = "4-6-6-4" AND class = "z-7" | SELECT "manufacturer" FROM "table_name_34" WHERE "4-6-6-4" = "wheel_arrangement" AND "class" = "z-7" | 0.097656 |
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title 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 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 procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE 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_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
| what number of hours has it been since the last time patient 25733 was prescribed propofol on this hospital visit? | 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 = 25733 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'propofol' 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" = 25733 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" = 'propofol' AND NOT "_u_0"."" IS NULL ORDER BY "prescriptions"."startdate" DESC NULLS LAST LIMIT 1 | 0.458008 |
CREATE TABLE table_79087 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" FLOAT, "Results" TEXT)
| Who is the incumbent who was first elected before 2002 from the maryland 3 district? | SELECT "Incumbent" FROM table_79087 WHERE "First elected" < '2002' AND "District" = 'maryland 3' | SELECT "Incumbent" FROM "table_79087" WHERE "District" = 'maryland 3' AND "First elected" < '2002' | 0.095703 |
CREATE TABLE table_name_72 (opponent_in_final VARCHAR, date VARCHAR, surface VARCHAR, location VARCHAR)
| What is Opponent In Final, when Surface is Hard, when Location is Wellington, New Zealand, and when Date is 6 February 2000? | SELECT opponent_in_final FROM table_name_72 WHERE surface = "hard" AND location = "wellington, new zealand" AND date = "6 february 2000" | SELECT "opponent_in_final" FROM "table_name_72" WHERE "6 february 2000" = "date" AND "hard" = "surface" AND "location" = "wellington, new zealand" | 0.142578 |
CREATE TABLE table_54174 ("Date" TEXT, "Result" TEXT, "Opponent" TEXT, "Location" TEXT, "Method" TEXT)
| What is the location for the win against Johan Mparmpagiannis? | SELECT "Location" FROM table_54174 WHERE "Result" = 'win' AND "Opponent" = 'johan mparmpagiannis' | SELECT "Location" FROM "table_54174" WHERE "Opponent" = 'johan mparmpagiannis' AND "Result" = 'win' | 0.09668 |
CREATE TABLE table_name_60 (november INT, record VARCHAR)
| What is the latest day in November of the game with a 15-5-2 record? | SELECT MAX(november) FROM table_name_60 WHERE record = "15-5-2" | SELECT MAX("november") FROM "table_name_60" WHERE "15-5-2" = "record" | 0.067383 |
CREATE TABLE tryout (pid DECIMAL, cname TEXT, ppos TEXT, decision TEXT)
CREATE TABLE college (cname TEXT, state TEXT, enr DECIMAL)
CREATE TABLE player (pid DECIMAL, pname TEXT, ycard TEXT, hs DECIMAL)
| Find the states where have some college students in tryout. | SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname | SELECT DISTINCT "state" FROM "college" AS "T1" JOIN "tryout" AS "T2" ON "T1"."cname" = "T2"."cname" | 0.09668 |
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE 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 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 d_icd_procedures (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 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_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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost 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 inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
| during the previous year, what were the top five most frequent specimen tests given to a patient during the same hospital visit after the diagnosis of unilat inguinal hernia? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'unilat inguinal hernia') AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1 JOIN (SELECT admissions.subject_id, microbiologyevents.spec_type_desc, microbiologyevents.charttime, admissions.hadm_id FROM microbiologyevents JOIN admissions ON microbiologyevents.hadm_id = admissions.hadm_id WHERE DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 ON t1.subject_id = t2.subject_id WHERE t1.charttime < t2.charttime AND t1.hadm_id = t2.hadm_id GROUP BY t2.spec_type_desc) AS t3 WHERE t3.c1 <= 5 | WITH "t2" AS (SELECT "admissions"."subject_id", "microbiologyevents"."spec_type_desc", "microbiologyevents"."charttime", "admissions"."hadm_id" FROM "microbiologyevents" JOIN "admissions" ON "admissions"."hadm_id" = "microbiologyevents"."hadm_id" WHERE DATETIME("microbiologyevents"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')), "t3" AS (SELECT "t2"."spec_type_desc", DENSE_RANK() OVER (ORDER BY COUNT(*) DESC NULLS LAST) AS "c1" FROM "diagnoses_icd" JOIN "d_icd_diagnoses" ON "d_icd_diagnoses"."icd9_code" = "diagnoses_icd"."icd9_code" AND "d_icd_diagnoses"."short_title" = 'unilat inguinal hernia' JOIN "admissions" ON "admissions"."hadm_id" = "diagnoses_icd"."hadm_id" JOIN "t2" AS "t2" ON "admissions"."hadm_id" = "t2"."hadm_id" AND "admissions"."subject_id" = "t2"."subject_id" AND "diagnoses_icd"."charttime" < "t2"."charttime" WHERE DATETIME("diagnoses_icd"."charttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY "t2"."spec_type_desc") SELECT "t3"."spec_type_desc" FROM "t3" AS "t3" WHERE "t3"."c1" <= 5 | 1.064453 |
CREATE TABLE table_73894 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original air date" TEXT, "Production code" TEXT)
| What is the title of the episode with the original air date October 21, 1998? | SELECT "Title" FROM table_73894 WHERE "Original air date" = 'October 21, 1998' | SELECT "Title" FROM "table_73894" WHERE "Original air date" = 'October 21, 1998' | 0.078125 |
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseReasonTypes (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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
| Questions with a single tag. | SELECT Id AS "post_link", CreationDate, Score FROM Posts WHERE Tags = '<' + LOWER('##TagName:string##') + '>' ORDER BY CreationDate DESC LIMIT 100 | SELECT "Id" AS "post_link", "CreationDate", "Score" FROM "Posts" WHERE "Tags" = CONCAT(CONCAT('<', LOWER('##TagName:string##')), '>') ORDER BY "CreationDate" DESC NULLS LAST LIMIT 100 | 0.178711 |
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)
| when was the last time patient 11688 was admitted into the hospital in 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 11688 AND STRFTIME('%y', admissions.admittime) = '2104' ORDER BY admissions.admittime DESC LIMIT 1 | SELECT "admissions"."admittime" FROM "admissions" WHERE "admissions"."subject_id" = 11688 AND STRFTIME('%y', "admissions"."admittime") = '2104' ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1 | 0.196289 |
CREATE TABLE table_204_95 (id DECIMAL, "name" TEXT, "title" TEXT, "first year\ in this position" DECIMAL, "years at nebraska" TEXT, "alma mater" TEXT)
| which coach started in the same year as charles armstrong ? | SELECT "name" FROM table_204_95 WHERE "name" <> 'charles armstrong' AND "first year\nin this position" = (SELECT "first year\nin this position" FROM table_204_95 WHERE "name" = 'charles armstrong') | SELECT "name" FROM "table_204_95" WHERE "first year\nin this position" = (SELECT "first year\nin this position" FROM "table_204_95" WHERE "name" = 'charles armstrong') AND "name" <> 'charles armstrong' | 0.196289 |
CREATE TABLE table_57064 ("Race" TEXT, "Date" TEXT, "Location" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Race Winner" TEXT, "Constructor" TEXT, "Report" TEXT)
| What Brands Hatch race had Niki Lauda as its Fastest Lap? | SELECT "Race" FROM table_57064 WHERE "Fastest Lap" = 'niki lauda' AND "Location" = 'brands hatch' | SELECT "Race" FROM "table_57064" WHERE "Fastest Lap" = 'niki lauda' AND "Location" = 'brands hatch' | 0.09668 |
CREATE TABLE table_204_19 (id DECIMAL, "university" TEXT, "winner" DECIMAL, "runner-up" DECIMAL, "years won" TEXT, "years runner-up" TEXT)
| which university had the most years won ? | SELECT "university" FROM table_204_19 ORDER BY "winner" DESC LIMIT 1 | SELECT "university" FROM "table_204_19" ORDER BY "winner" DESC NULLS LAST LIMIT 1 | 0.079102 |
CREATE TABLE table_6425 ("Make/ Model" TEXT, "length" TEXT, "Year" FLOAT, "Numbers ( Quantity Ordered ) " TEXT, "Fuel Propulsion" TEXT)
| How many years have a Make/ Model of new flyer c40lfr? | SELECT COUNT("Year") FROM table_6425 WHERE "Make/ Model" = 'new flyer c40lfr' | SELECT COUNT("Year") FROM "table_6425" WHERE "Make/ Model" = 'new flyer c40lfr' | 0.077148 |
CREATE TABLE table_42540 ("Result" TEXT, "Opponent" TEXT, "Type" TEXT, "Round" TEXT, "Date" TEXT)
| Which Opponent has a Type of tko, and a Round of 2 (6) on 2006-09-20? | SELECT "Opponent" FROM table_42540 WHERE "Type" = 'tko' AND "Round" = '2 (6)' AND "Date" = '2006-09-20' | SELECT "Opponent" FROM "table_42540" WHERE "Date" = '2006-09-20' AND "Round" = '2 (6)' AND "Type" = 'tko' | 0.102539 |
CREATE TABLE table_65258 ("Tie no" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Date" TEXT)
| who is the home team when the away team is wolverhampton wanderers? | SELECT "Home team" FROM table_65258 WHERE "Away team" = 'wolverhampton wanderers' | SELECT "Home team" FROM "table_65258" WHERE "Away team" = 'wolverhampton wanderers' | 0.081055 |
CREATE TABLE races (raceId INT, year INT, round INT, circuitId INT, name TEXT, date TEXT, time TEXT, url TEXT)
CREATE TABLE lapTimes (raceId INT, driverId INT, lap INT, position INT, time TEXT, milliseconds INT)
CREATE TABLE status (statusId INT, status TEXT)
CREATE TABLE driverStandings (driverStandingsId INT, raceId INT, driverId INT, points FLOAT, position INT, positionText TEXT, wins INT)
CREATE TABLE pitStops (raceId INT, driverId INT, stop INT, lap INT, time TEXT, duration TEXT, milliseconds INT)
CREATE TABLE constructors (constructorId INT, constructorRef TEXT, name TEXT, nationality TEXT, url TEXT)
CREATE TABLE drivers (driverId INT, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT)
CREATE TABLE constructorResults (constructorResultsId INT, raceId INT, constructorId INT, points FLOAT, status TEXT)
CREATE TABLE seasons (year INT, url TEXT)
CREATE TABLE results (resultId INT, raceId INT, driverId INT, constructorId INT, number INT, grid INT, position TEXT, positionText TEXT, positionOrder INT, points FLOAT, laps TEXT, time TEXT, milliseconds TEXT, fastestLap TEXT, rank TEXT, fastestLapTime TEXT, fastestLapSpeed TEXT, statusId INT)
CREATE TABLE constructorStandings (constructorStandingsId INT, raceId INT, constructorId INT, points FLOAT, position INT, positionText TEXT, wins INT)
CREATE TABLE circuits (circuitId INT, circuitRef TEXT, name TEXT, location TEXT, country TEXT, lat FLOAT, lng FLOAT, alt TEXT, url TEXT)
CREATE TABLE qualifying (qualifyId INT, raceId INT, driverId INT, constructorId INT, number INT, position INT, q1 TEXT, q2 TEXT, q3 TEXT)
| Show the number of races that had any driver whose forename is Lewis in each year with a line chart, sort in ascending by the x-axis. | SELECT year, COUNT(year) FROM results AS T1 JOIN races AS T2 ON T1.raceId = T2.raceId JOIN drivers AS T3 ON T1.driverId = T3.driverId WHERE T3.forename = "Lewis" GROUP BY year ORDER BY year | SELECT "year", COUNT("year") FROM "results" AS "T1" JOIN "races" AS "T2" ON "T1"."raceId" = "T2"."raceId" JOIN "drivers" AS "T3" ON "Lewis" = "T3"."forename" AND "T1"."driverId" = "T3"."driverId" GROUP BY "year" ORDER BY "year" NULLS FIRST | 0.233398 |
CREATE TABLE table_203_466 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
| largest medal differential between countries | SELECT MAX("total") - MIN("total") FROM table_203_466 | SELECT MAX("total") - MIN("total") FROM "table_203_466" | 0.053711 |
CREATE TABLE table_48617 ("Date" TEXT, "Pos." TEXT, "Player" TEXT, "From club" TEXT, "Transfer fee" TEXT)
| What is Pos., when Player is 'Nigel De Jong'? | SELECT "Pos." FROM table_48617 WHERE "Player" = 'nigel de jong' | SELECT "Pos." FROM "table_48617" WHERE "Player" = 'nigel de jong' | 0.063477 |
CREATE TABLE table_40993 ("Position" FLOAT, "Team" TEXT, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" TEXT)
| What's the highest against score that drew more than 5, and had more than 18 points? | SELECT MAX("Against") FROM table_40993 WHERE "Drawn" > '5' AND "Points" > '18' | SELECT MAX("Against") FROM "table_40993" WHERE "Drawn" > '5' AND "Points" > '18' | 0.078125 |
CREATE TABLE table_name_27 (first_cap VARCHAR, caps VARCHAR)
| When was the first cap associated with 74 caps? | SELECT first_cap FROM table_name_27 WHERE caps = 74 | SELECT "first_cap" FROM "table_name_27" WHERE "caps" = 74 | 0.055664 |
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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description 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 PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
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 VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE ReviewTaskTypes (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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (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)
| Where are these users now??. | SELECT * FROM Users WHERE AccountId = 14245410 | SELECT * FROM "Users" WHERE "AccountId" = 14245410 | 0.048828 |
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_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
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 d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
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)
| what was the organism found in patient 25997's first test of blood culture since 79 months ago? | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25997) AND microbiologyevents.spec_type_desc = 'blood culture' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-79 month') ORDER BY microbiologyevents.charttime LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 25997 GROUP BY "hadm_id") SELECT "microbiologyevents"."org_name" FROM "microbiologyevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "microbiologyevents"."hadm_id" WHERE "microbiologyevents"."spec_type_desc" = 'blood culture' AND DATETIME("microbiologyevents"."charttime") >= DATETIME(CURRENT_TIME(), '-79 month') AND NOT "_u_0"."" IS NULL AND NOT "microbiologyevents"."org_name" IS NULL ORDER BY "microbiologyevents"."charttime" NULLS FIRST LIMIT 1 | 0.53418 |
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (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 diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_diagnoses (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 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 cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| when was the last time in the last hospital visit patient 9833 was prescribed for a drug? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 9833 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1 | SELECT "prescriptions"."startdate" FROM "prescriptions" WHERE "prescriptions"."hadm_id" IN (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 9833 AND NOT "admissions"."dischtime" IS NULL ORDER BY "admissions"."admittime" DESC NULLS LAST LIMIT 1) ORDER BY "prescriptions"."startdate" DESC NULLS LAST LIMIT 1 | 0.331055 |
CREATE TABLE table_name_88 (opponent VARCHAR, date VARCHAR)
| Who is the opponent on November 20, 1966? | SELECT opponent FROM table_name_88 WHERE date = "november 20, 1966" | SELECT "opponent" FROM "table_name_88" WHERE "date" = "november 20, 1966" | 0.071289 |
CREATE TABLE table_79446 ("Year" FLOAT, "Program" TEXT, "Role" TEXT, "Episode" TEXT, "First aired" TEXT)
| What's the episode of Batman? | SELECT "Episode" FROM table_79446 WHERE "Program" = 'batman' | SELECT "Episode" FROM "table_79446" WHERE "Program" = 'batman' | 0.060547 |
CREATE TABLE table_52104 ("Week" FLOAT, "Date" TEXT, "Opponent" TEXT, "Result" TEXT, "Attendance" FLOAT)
| I want the date for week less than 5 and attendance more than 43,922 with a result of w 21-7 | SELECT "Date" FROM table_52104 WHERE "Week" < '5' AND "Attendance" > '43,922' AND "Result" = 'w 21-7' | SELECT "Date" FROM "table_52104" WHERE "Attendance" > '43,922' AND "Result" = 'w 21-7' AND "Week" < '5' | 0.100586 |
CREATE TABLE table_203_576 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
| which nation earned the most bronze medals , thailand or south korea ? | SELECT "nation" FROM table_203_576 WHERE "nation" IN ('thailand', 'south korea') ORDER BY "bronze" DESC LIMIT 1 | SELECT "nation" FROM "table_203_576" WHERE "nation" IN ('thailand', 'south korea') ORDER BY "bronze" DESC NULLS LAST LIMIT 1 | 0.121094 |
CREATE TABLE table_13041 ("Average population ( x 1000 ) " FLOAT, "Live births" TEXT, "Deaths" TEXT, "Natural change" TEXT, "Crude birth rate ( per 1000 ) " FLOAT, "Crude death rate ( per 1000 ) " FLOAT, "Natural change ( per 1000 ) " FLOAT)
| What is the average population when deaths are 3 557 and crude death date is less than 11.9? | SELECT AVG("Average population (x 1000)") FROM table_13041 WHERE "Deaths" = '3 557' AND "Crude death rate (per 1000)" < '11.9' | SELECT AVG("Average population (x 1000)") FROM "table_13041" WHERE "Crude death rate (per 1000)" < '11.9' AND "Deaths" = '3 557' | 0.125 |
CREATE TABLE table_name_69 (name VARCHAR)
| What is the name of the 2008 club with Nadia Centoni Category:Articles with hCards? | SELECT 2008 AS _club FROM table_name_69 WHERE name = "nadia centoni category:articles with hcards" | SELECT 2008 AS "_club" FROM "table_name_69" WHERE "nadia centoni category:articles with hcards" = "name" | 0.101563 |
CREATE TABLE table_51838 ("Date" TEXT, "Tournament" TEXT, "Surface" TEXT, "Opponent in the final" TEXT, "Score" TEXT)
| WHAT WAS THE SCORE IN THE FINAL AGAINST RABIE CHAKI? | SELECT "Score" FROM table_51838 WHERE "Opponent in the final" = 'rabie chaki' | SELECT "Score" FROM "table_51838" WHERE "Opponent in the final" = 'rabie chaki' | 0.077148 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
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)
| what is admission location and diagnoses long title of subject id 2560? | SELECT demographic.admission_location, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560" | SELECT "demographic"."admission_location", "diagnoses"."long_title" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "2560" = "demographic"."subject_id" | 0.191406 |
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE 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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId 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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTaskStates (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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
| Thanks' comments by OP. | SELECT PostId AS "post_link" FROM Comments WHERE UserId = (SELECT OwnerUserId FROM Posts WHERE Id = PostId AND Text LIKE '% %') ORDER BY Comments.CreationDate DESC LIMIT 1000 | SELECT "PostId" AS "post_link" FROM "Comments" WHERE "UserId" = (SELECT "OwnerUserId" FROM "Posts" WHERE "Id" = "PostId" AND "Text" LIKE '% %') ORDER BY "Comments"."CreationDate" DESC NULLS LAST LIMIT 1000 | 0.200195 |
CREATE TABLE table_name_9 (club_team VARCHAR, round VARCHAR, position VARCHAR)
| What Club team with a Round larger than 5 have a defense position? | SELECT club_team FROM table_name_9 WHERE round > 5 AND position = "defense" | SELECT "club_team" FROM "table_name_9" WHERE "defense" = "position" AND "round" > 5 | 0.081055 |
CREATE TABLE table_name_61 (season INT, position VARCHAR)
| What is the highest season for the 7th position? | SELECT MAX(season) FROM table_name_61 WHERE position = "7th" | SELECT MAX("season") FROM "table_name_61" WHERE "7th" = "position" | 0.064453 |
CREATE TABLE table_name_54 (on_air_id VARCHAR, band VARCHAR, callsign VARCHAR)
| What is the On-air ID of FM broadcaster 4nsa? | SELECT on_air_id FROM table_name_54 WHERE band = "fm" AND callsign = "4nsa" | SELECT "on_air_id" FROM "table_name_54" WHERE "4nsa" = "callsign" AND "band" = "fm" | 0.081055 |
CREATE TABLE record (ID INT, Result TEXT, Swimmer_ID INT, Event_ID INT)
CREATE TABLE swimmer (ID INT, name TEXT, Nationality TEXT, meter_100 FLOAT, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT)
CREATE TABLE event (ID INT, Name TEXT, Stadium_ID INT, Year TEXT)
CREATE TABLE stadium (ID INT, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT)
| Return a bar chart about the distribution of meter_400 and meter_100 , and rank X in descending order. | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_400 DESC | SELECT "meter_400", "meter_100" FROM "swimmer" ORDER BY "meter_400" DESC NULLS LAST | 0.081055 |
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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description 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 ReviewTaskTypes (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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE FlagTypes (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 ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE 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 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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
| Questions with titles containing given word. | SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%##word##%' ORDER BY CreationDate | SELECT "Id" AS "post_link" FROM "Posts" WHERE "PostTypeId" = 1 AND "Title" LIKE '%##word##%' ORDER BY "CreationDate" NULLS FIRST | 0.125 |
CREATE TABLE table_name_33 (platform_s_ VARCHAR, developer_s_ VARCHAR)
| What's the platform that has Rockstar Games as the developer? | SELECT platform_s_ FROM table_name_33 WHERE developer_s_ = "rockstar games" | SELECT "platform_s_" FROM "table_name_33" WHERE "developer_s_" = "rockstar games" | 0.079102 |
CREATE TABLE table_26875 ("Name" TEXT, "Nationality" TEXT, "Position" TEXT, "Los Angeles Sol career" TEXT, "Appearances" FLOAT, "Starts" FLOAT, "Minutes" FLOAT, "Goals" FLOAT, "Assists" FLOAT)
| Name the most minutes and starts being 12 | SELECT MAX("Minutes") FROM table_26875 WHERE "Starts" = '12' | SELECT MAX("Minutes") FROM "table_26875" WHERE "Starts" = '12' | 0.060547 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.