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_21302_1 (no_of_villages VARCHAR, density_persons___ha VARCHAR)
| How many villages have a density persons/ha of 5.5? | SELECT COUNT(no_of_villages) FROM table_21302_1 WHERE density_persons___ha = "5.5" | SELECT COUNT("no_of_villages") FROM "table_21302_1" WHERE "5.5" = "density_persons___ha" | 0.085938 |
CREATE TABLE table_name_47 (venue VARCHAR, competition VARCHAR)
| Where did the Paris Marathon occur? | SELECT venue FROM table_name_47 WHERE competition = "paris marathon" | SELECT "venue" FROM "table_name_47" WHERE "competition" = "paris marathon" | 0.072266 |
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)
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)
| what is admission time and diagnoses icd9 code of subject id 1875? | SELECT demographic.admittime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "1875" | SELECT "demographic"."admittime", "diagnoses"."icd9_code" FROM "demographic" JOIN "diagnoses" ON "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "1875" = "demographic"."subject_id" | 0.181641 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| count the number of patients whose procedure title is oth uni salpingo-oophor. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Oth uni salpingo-oophor" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Oth uni salpingo-oophor" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" | 0.192383 |
CREATE TABLE table_52229 ("DVD Name" TEXT, "Released" TEXT, "Audio" TEXT, "Aspect Ratio" TEXT, "Duration" TEXT, "Number of Episodes" FLOAT, "Num of Discs" FLOAT)
| What DVD has a time of 2 hours 22 minutes? | SELECT "DVD Name" FROM table_52229 WHERE "Duration" = '2 hours 22 minutes' | SELECT "DVD Name" FROM "table_52229" WHERE "Duration" = '2 hours 22 minutes' | 0.074219 |
CREATE TABLE Payments (Payment_ID INT, Settlement_ID INT, Payment_Method_Code VARCHAR, Date_Payment_Made DATE, Amount_Payment INT)
CREATE TABLE Settlements (Settlement_ID INT, Claim_ID INT, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INT, Amount_Settled INT, Customer_Policy_ID INT)
CREATE TABLE Customers (Customer_ID INT, Customer_Details VARCHAR)
CREATE TABLE Claims (Claim_ID INT, Policy_ID INT, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INT, Amount_Settled INT)
CREATE TABLE Customer_Policies (Policy_ID INT, Customer_ID INT, Policy_Type_Code CHAR, Start_Date DATE, End_Date DATE)
| For those payments processed with Visa, bin the payment day into the Day of Week interval and compute the total amount payment as the Y-axis, I want to sort by the y axis in descending. | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY SUM(Amount_Payment) DESC | SELECT "Date_Payment_Made", SUM("Amount_Payment") FROM "Payments" WHERE "Payment_Method_Code" = 'Visa' ORDER BY SUM("Amount_Payment") DESC NULLS LAST | 0.145508 |
CREATE TABLE musical (Musical_ID INT, Name TEXT, Year INT, Award TEXT, Category TEXT, Nominee TEXT, Result TEXT)
CREATE TABLE actor (Actor_ID INT, Name TEXT, Musical_ID INT, Character TEXT, Duration TEXT, age INT)
| Bar chart x axis duration y axis how many duration, display by the y axis in asc. | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY COUNT(Duration) | SELECT "Duration", COUNT("Duration") FROM "actor" GROUP BY "Duration" ORDER BY COUNT("Duration") NULLS FIRST | 0.105469 |
CREATE TABLE table_10536 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Which away team scored 9.11 (65)? | SELECT "Away team" FROM table_10536 WHERE "Away team score" = '9.11 (65)' | SELECT "Away team" FROM "table_10536" WHERE "Away team score" = '9.11 (65)' | 0.073242 |
CREATE TABLE table_63397 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Event" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| What the round with the time 1:15? | SELECT AVG("Round") FROM table_63397 WHERE "Time" = '1:15' | SELECT AVG("Round") FROM "table_63397" WHERE "Time" = '1:15' | 0.058594 |
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
| i would like a flight from BOSTON to DENVER on monday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = days.days_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND flight.from_airport = AIRPORT_SERVICE_0.airport_code | SELECT DISTINCT "flight"."flight_id" FROM "airport_service" AS "AIRPORT_SERVICE_0" JOIN "date_day" ON "date_day"."day_number" = 21 AND "date_day"."month_number" = 2 AND "date_day"."year" = 1991 JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'BOSTON' JOIN "days" ON "date_day"."day_name" = "days"."day_name" JOIN "flight" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" AND "days"."days_code" = "flight"."flight_days" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'DENVER' | 0.703125 |
CREATE TABLE table_name_45 (company VARCHAR, country VARCHAR, author VARCHAR)
| What is the company from Greece with author Aeschylus? | SELECT company FROM table_name_45 WHERE country = "greece" AND author = "aeschylus" | SELECT "company" FROM "table_name_45" WHERE "aeschylus" = "author" AND "country" = "greece" | 0.088867 |
CREATE TABLE Documents (document_type_code VARCHAR)
| Show the document type code with fewer than 3 documents. | SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING COUNT(*) < 3 | SELECT "document_type_code" FROM "Documents" GROUP BY "document_type_code" HAVING COUNT(*) < 3 | 0.091797 |
CREATE TABLE member (Member_ID INT, Name TEXT, Country TEXT, College_ID INT)
CREATE TABLE college (College_ID INT, Name TEXT, Leader_Name TEXT, College_Location TEXT)
CREATE TABLE round (Round_ID INT, Member_ID INT, Decoration_Theme TEXT, Rank_in_Round INT)
| Plot the total number by grouped by country as a bar graph | SELECT Country, COUNT(*) FROM member GROUP BY Country | SELECT "Country", COUNT(*) FROM "member" GROUP BY "Country" | 0.057617 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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)
| count the number of patients whose diagnoses long title is acquired coagulation factor deficiency and drug type is additive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Acquired coagulation factor deficiency" AND prescriptions.drug_type = "ADDITIVE" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Acquired coagulation factor deficiency" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" JOIN "prescriptions" ON "ADDITIVE" = "prescriptions"."drug_type" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" | 0.321289 |
CREATE TABLE products (product_id VARCHAR, product_name VARCHAR)
CREATE TABLE order_items (product_id VARCHAR, order_item_status VARCHAR, order_id VARCHAR)
CREATE TABLE orders (customer_id VARCHAR, order_id VARCHAR)
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR)
| List the names of customers who have once canceled the purchase of the product 'food' (the item status is 'Cancel'). | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T3.order_item_status = "Cancel" AND T4.product_name = "food" GROUP BY T1.customer_id HAVING COUNT(*) >= 1 | SELECT "T1"."customer_name" FROM "customers" AS "T1" JOIN "order_items" AS "T3" ON "Cancel" = "T3"."order_item_status" JOIN "orders" AS "T2" ON "T1"."customer_id" = "T2"."customer_id" AND "T2"."order_id" = "T3"."order_id" JOIN "products" AS "T4" ON "T3"."product_id" = "T4"."product_id" AND "T4"."product_name" = "food" GROUP BY "T1"."customer_id" HAVING COUNT(*) >= 1 | 0.359375 |
CREATE TABLE table_name_7 (promotion VARCHAR, event VARCHAR)
| What is the promotion when the event was Acid-fest? | SELECT promotion FROM table_name_7 WHERE event = "acid-fest" | SELECT "promotion" FROM "table_name_7" WHERE "acid-fest" = "event" | 0.064453 |
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
| Bar chart of all_games_percent from each all road | SELECT All_Road, All_Games_Percent FROM basketball_match | SELECT "All_Road", "All_Games_Percent" FROM "basketball_match" | 0.060547 |
CREATE TABLE table_1043 ("Player" TEXT, "Position" TEXT, "Starter" TEXT, "Touchdowns" FLOAT, "Extra points" FLOAT, "Field goals" FLOAT, "Points" FLOAT)
| What is the lowest amount of field goals on the chart? | SELECT MIN("Field goals") FROM table_1043 | SELECT MIN("Field goals") FROM "table_1043" | 0.041992 |
CREATE TABLE table_name_7 (copyright_information VARCHAR, publisher VARCHAR)
| What was Random House's copyright information? | SELECT copyright_information FROM table_name_7 WHERE publisher = "random house" | SELECT "copyright_information" FROM "table_name_7" WHERE "publisher" = "random house" | 0.083008 |
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)
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)
| what is the number of male patients who had home health care discharge? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "HOME HEALTH CARE" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "HOME HEALTH CARE" = "demographic"."discharge_location" AND "M" = "demographic"."gender" | 0.15918 |
CREATE TABLE table_name_52 (record VARCHAR, loss VARCHAR)
| Loss of willis has what record? | SELECT record FROM table_name_52 WHERE loss = "willis" | SELECT "record" FROM "table_name_52" WHERE "loss" = "willis" | 0.058594 |
CREATE TABLE table_5597 ("Date Released" TEXT, "Institute" TEXT, "Socialist" TEXT, "Social Democratic" TEXT, "Green-Communist" TEXT, "Left Bloc" TEXT, "People's Party" TEXT, "Lead" TEXT)
| Name the lead for institute of election results and social democratic of 31.7% 8 seats | SELECT "Lead" FROM table_5597 WHERE "Institute" = 'election results' AND "Social Democratic" = '31.7% 8 seats' | SELECT "Lead" FROM "table_5597" WHERE "Institute" = 'election results' AND "Social Democratic" = '31.7% 8 seats' | 0.109375 |
CREATE TABLE table_name_45 (top_25 INT, events VARCHAR, wins VARCHAR)
| What is the Top-25 with an Events of 20, and a Wins larger than 2? | SELECT AVG(top_25) FROM table_name_45 WHERE events = 20 AND wins > 2 | SELECT AVG("top_25") FROM "table_name_45" WHERE "events" = 20 AND "wins" > 2 | 0.074219 |
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| have patient 022-89058's been prescribed acetaminophen, 50 ml vial : dextrose 50 % iv soln, or acetaminophen (tylenol) tablet 650 mg on the first hospital encounter? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1)) AND medication.drugname IN ('acetaminophen', '50 ml vial : dextrose 50 % iv soln', 'acetaminophen (tylenol) tablet 650 mg') | SELECT COUNT(*) > 0 FROM "medication" WHERE "medication"."drugname" IN ('acetaminophen', '50 ml vial : dextrose 50 % iv soln', 'acetaminophen (tylenol) tablet 650 mg') AND "medication"."patientunitstayid" IN (SELECT "patient"."patientunitstayid" FROM "patient" WHERE "patient"."patienthealthsystemstayid" IN (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '022-89058' AND NOT "patient"."hospitaldischargetime" IS NULL ORDER BY "patient"."hospitaladmittime" NULLS FIRST LIMIT 1)) | 0.508789 |
CREATE TABLE table_name_2 (tournament VARCHAR)
| Which 2010 stat featured the tournament of the Olympic Games? | SELECT 2010 FROM table_name_2 WHERE tournament = "olympic games" | SELECT 2010 FROM "table_name_2" WHERE "olympic games" = "tournament" | 0.066406 |
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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE 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 PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId 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 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
| Questions with more than 5 tags. | SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE LENGTH(Tags) - LENGTH(REPLACE(Tags, '<', '')) > 5 | SELECT "Id" AS "post_link", "CreationDate", "Tags" FROM "Posts" WHERE LENGTH("Tags") - LENGTH(REPLACE("Tags", '<', '')) > 5 | 0.120117 |
CREATE TABLE table_159614_2 (opinion_research_centre__opc_ VARCHAR, national_opinion_polls__nop_ VARCHAR)
| On all other parties the National option polls are at 1.3% where as the opinion research pole is at what percentage? | SELECT opinion_research_centre__opc_ FROM table_159614_2 WHERE national_opinion_polls__nop_ = "1.3%" | SELECT "opinion_research_centre__opc_" FROM "table_159614_2" WHERE "1.3%" = "national_opinion_polls__nop_" | 0.103516 |
CREATE TABLE table_31412 ("Rank" FLOAT, "Country/Territory" TEXT, "Miss Earth" TEXT, "Miss Air" FLOAT, "Miss Water" FLOAT, "Miss Fire" FLOAT, "Semifinalists" FLOAT, "Total" FLOAT)
| What is the most Miss Fires any country has had? | SELECT MAX("Miss Fire") FROM table_31412 | SELECT MAX("Miss Fire") FROM "table_31412" | 0.041016 |
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 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 PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE PostTypes (Id DECIMAL, Name 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 SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId 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 PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (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 ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
| Which question has the most comments?. | SELECT Id AS "post_link", * FROM Posts WHERE PostTypeId = 1 ORDER BY CommentCount DESC LIMIT 1 | SELECT "Id" AS "post_link", * FROM "Posts" WHERE "PostTypeId" = 1 ORDER BY "CommentCount" DESC NULLS LAST LIMIT 1 | 0.110352 |
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE code_description (code VARCHAR, description TEXT)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE flight (aircraft_code_sequence TEXT, airline_code VARCHAR, airline_flight TEXT, arrival_time INT, connections INT, departure_time INT, dual_carrier TEXT, flight_days TEXT, flight_id INT, flight_number INT, from_airport VARCHAR, meal_code TEXT, stops INT, time_elapsed INT, to_airport VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE airport (airport_code VARCHAR, airport_name TEXT, airport_location TEXT, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR, minimum_connect_time INT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE fare_basis (fare_basis_code TEXT, booking_class TEXT, class_type TEXT, premium TEXT, economy TEXT, discounted TEXT, night TEXT, season TEXT, basis_days TEXT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
| list ground transportation in DETROIT | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DETROIT' AND ground_service.city_code = city.city_code | SELECT DISTINCT "ground_service"."transport_type" FROM "city" JOIN "ground_service" ON "city"."city_code" = "ground_service"."city_code" WHERE "city"."city_name" = 'DETROIT' | 0.168945 |
CREATE TABLE table_name_91 (match VARCHAR, opponent VARCHAR)
| What was the match that happened in Bishop's Stortford? | SELECT match FROM table_name_91 WHERE opponent = "bishop's stortford" | SELECT "match" FROM "table_name_91" WHERE "bishop's stortford" = "opponent" | 0.073242 |
CREATE TABLE Student (Spent INT)
CREATE TABLE Visits_Restaurant (Spent INT)
| How long does student Linda Smith spend on the restaurant in total? | SELECT SUM(Spent) FROM Student JOIN Visits_Restaurant ON Student.StuID = Visits_Restaurant.StuID WHERE Student.Fname = "Linda" AND Student.Lname = "Smith" | SELECT SUM("Spent") FROM "Student" JOIN "Visits_Restaurant" ON "Student"."StuID" = "Visits_Restaurant"."StuID" WHERE "Linda" = "Student"."Fname" AND "Smith" = "Student"."Lname" | 0.171875 |
CREATE TABLE table_42798 ("Name" TEXT, "Position" TEXT, "Number" FLOAT, "Season" TEXT, "Acquisition via" TEXT)
| What is the name of the player acquired via import and larger than 22? | SELECT "Name" FROM table_42798 WHERE "Acquisition via" = 'import' AND "Number" > '22' | SELECT "Name" FROM "table_42798" WHERE "Acquisition via" = 'import' AND "Number" > '22' | 0.084961 |
CREATE TABLE table_49516 ("Poll Source" TEXT, "Dates administered" TEXT, "Democrat: Vivian Davis Figures" TEXT, "Republican: Jeff Sessions" TEXT, "Lead Margin" FLOAT)
| What is the date administered when Vivian Davis Figures was at 36%? | SELECT "Dates administered" FROM table_49516 WHERE "Democrat: Vivian Davis Figures" = '36%' | SELECT "Dates administered" FROM "table_49516" WHERE "Democrat: Vivian Davis Figures" = '36%' | 0.09082 |
CREATE TABLE table_35592 ("Game" FLOAT, "Date" TEXT, "Team" TEXT, "Score" TEXT, "High points" TEXT, "High rebounds" TEXT, "High assists" TEXT, "Location Attendance" TEXT, "Record" TEXT)
| Who had the highest assists during the game on February 22? | SELECT "High assists" FROM table_35592 WHERE "Date" = 'february 22' | SELECT "High assists" FROM "table_35592" WHERE "Date" = 'february 22' | 0.067383 |
CREATE TABLE table_40264 ("Position" FLOAT, "Team" TEXT, "Points" FLOAT, "Played" FLOAT, "Drawn" FLOAT, "Lost" FLOAT, "Against" FLOAT, "Difference" TEXT)
| Which Position has an Against of 32, and a Difference of 18, and a Drawn larger than 4? | SELECT SUM("Position") FROM table_40264 WHERE "Against" = '32' AND "Difference" = '18' AND "Drawn" > '4' | SELECT SUM("Position") FROM "table_40264" WHERE "Against" = '32' AND "Difference" = '18' AND "Drawn" > '4' | 0.103516 |
CREATE TABLE table_name_57 (number_ VARCHAR, _name VARCHAR, description VARCHAR)
| What is the identifying number for a description of Stanier (Period III) full brake? | SELECT number_ & _name FROM table_name_57 WHERE description = "stanier (period iii) full brake" | SELECT "number_" & "_name" FROM "table_name_57" WHERE "description" = "stanier (period iii) full brake" | 0.100586 |
CREATE TABLE table_65907 ("Rank" FLOAT, "Nation" TEXT, "Gold" FLOAT, "Silver" FLOAT, "Bronze" FLOAT, "Total" FLOAT)
| How many gold medals did Brazil win with a total of more than 55 medals? | SELECT AVG("Gold") FROM table_65907 WHERE "Nation" = 'brazil' AND "Total" > '55' | SELECT AVG("Gold") FROM "table_65907" WHERE "Nation" = 'brazil' AND "Total" > '55' | 0.080078 |
CREATE TABLE table_203_830 (id DECIMAL, "year" DECIMAL, "song" TEXT, "chart positions\ us country" DECIMAL, "chart positions\ can country" DECIMAL, "album" TEXT)
| which years had the least number of singles released ? | SELECT "year" FROM table_203_830 GROUP BY "year" HAVING COUNT("song") = (SELECT COUNT("song") FROM table_203_830 GROUP BY "year" ORDER BY COUNT("song") LIMIT 1) | SELECT "year" FROM "table_203_830" GROUP BY "year" HAVING COUNT("song") = (SELECT COUNT("song") FROM "table_203_830" GROUP BY "year" ORDER BY COUNT("song") NULLS FIRST LIMIT 1) | 0.171875 |
CREATE TABLE table_54531 ("Rider" TEXT, "Manufacturer" TEXT, "Laps" FLOAT, "Time/Retired" TEXT, "Grid" FLOAT)
| How many laps were timed at +1:02.315? | SELECT COUNT("Laps") FROM table_54531 WHERE "Time/Retired" = '+1:02.315' | SELECT COUNT("Laps") FROM "table_54531" WHERE "Time/Retired" = '+1:02.315' | 0.072266 |
CREATE TABLE table_name_83 (played INT, years VARCHAR)
| How many games did they play in 1905? | SELECT AVG(played) FROM table_name_83 WHERE years = "1905" | SELECT AVG("played") FROM "table_name_83" WHERE "1905" = "years" | 0.0625 |
CREATE TABLE table_13753 ("Round" FLOAT, "Opposition Team" TEXT, "Venue" TEXT, "Result" TEXT, "Report" TEXT)
| What venue was round 20 held at? | SELECT "Venue" FROM table_13753 WHERE "Round" = '20' | SELECT "Venue" FROM "table_13753" WHERE "Round" = '20' | 0.052734 |
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
CREATE TABLE employees (EMPLOYEE_ID DECIMAL, FIRST_NAME VARCHAR, LAST_NAME VARCHAR, EMAIL VARCHAR, PHONE_NUMBER VARCHAR, HIRE_DATE DATE, JOB_ID VARCHAR, SALARY DECIMAL, COMMISSION_PCT DECIMAL, MANAGER_ID DECIMAL, DEPARTMENT_ID DECIMAL)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
| For employees with first names that end with the letter m, groups and count the first name to visualize a bar graph, and could you display in desc by the x-axis? | SELECT FIRST_NAME, COUNT(FIRST_NAME) FROM employees WHERE FIRST_NAME LIKE '%m' GROUP BY FIRST_NAME ORDER BY FIRST_NAME DESC | SELECT "FIRST_NAME", COUNT("FIRST_NAME") FROM "employees" WHERE "FIRST_NAME" LIKE '%m' GROUP BY "FIRST_NAME" ORDER BY "FIRST_NAME" DESC NULLS LAST | 0.142578 |
CREATE TABLE country (Country_id INT, Country_name TEXT, Capital TEXT, Official_native_language TEXT)
CREATE TABLE team (Team_id INT, Name TEXT)
CREATE TABLE player (Player_ID INT, Player TEXT, Years_Played TEXT, Total_WL TEXT, Singles_WL TEXT, Doubles_WL TEXT, Team INT)
CREATE TABLE match_season (Season FLOAT, Player TEXT, Position TEXT, Country INT, Team INT, Draft_Pick_Number INT, Draft_Class TEXT, College TEXT)
| Show the country names and the corresponding number of players in a bar chart, I want to rank by the x axis from low to high. | SELECT Country_name, COUNT(*) FROM country AS T1 JOIN match_season AS T2 ON T1.Country_id = T2.Country GROUP BY T1.Country_name ORDER BY Country_name | SELECT "Country_name", COUNT(*) FROM "country" AS "T1" JOIN "match_season" AS "T2" ON "T1"."Country_id" = "T2"."Country" GROUP BY "T1"."Country_name" ORDER BY "Country_name" NULLS FIRST | 0.180664 |
CREATE TABLE table_name_20 (left_office VARCHAR, minister VARCHAR)
| Tell me the left office for mirko tremaglia | SELECT left_office FROM table_name_20 WHERE minister = "mirko tremaglia" | SELECT "left_office" FROM "table_name_20" WHERE "minister" = "mirko tremaglia" | 0.076172 |
CREATE TABLE exhibition_record (exhibition_id DECIMAL, date TEXT, attendance DECIMAL)
CREATE TABLE artist (artist_id DECIMAL, name TEXT, country TEXT, year_join DECIMAL, age DECIMAL)
CREATE TABLE exhibition (exhibition_id DECIMAL, year DECIMAL, theme TEXT, artist_id DECIMAL, ticket_price DECIMAL)
| What are the names of artist whose exhibitions draw over 200 attendees on average? | SELECT T3.name FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id JOIN artist AS T3 ON T3.artist_id = T2.artist_id GROUP BY T3.artist_id HAVING AVG(T1.attendance) > 200 | SELECT "T3"."name" FROM "exhibition_record" AS "T1" JOIN "exhibition" AS "T2" ON "T1"."exhibition_id" = "T2"."exhibition_id" JOIN "artist" AS "T3" ON "T2"."artist_id" = "T3"."artist_id" GROUP BY "T3"."artist_id" HAVING AVG("T1"."attendance") > 200 | 0.241211 |
CREATE TABLE table_2468961_4 (title VARCHAR, written_by VARCHAR, no_in_series VARCHAR)
| What was the title of the episode written by Julia Newton in series 48? | SELECT title FROM table_2468961_4 WHERE written_by = "Julia Newton" AND no_in_series = 48 | SELECT "title" FROM "table_2468961_4" WHERE "Julia Newton" = "written_by" AND "no_in_series" = 48 | 0.094727 |
CREATE TABLE university (School_ID INT, School TEXT, Location TEXT, Founded FLOAT, Affiliation TEXT, Enrollment FLOAT, Nickname TEXT, Primary_conference TEXT)
CREATE TABLE basketball_match (Team_ID INT, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT)
| A bar chart shows the distribution of All_Games and All_Games_Percent , I want to order x-axis in descending order please. | SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games DESC | SELECT "All_Games", "All_Games_Percent" FROM "basketball_match" ORDER BY "All_Games" DESC NULLS LAST | 0.097656 |
CREATE TABLE table_23907 ("School" TEXT, "Location ( s ) " TEXT, "Control" TEXT, "Type" TEXT, "Accreditation" TEXT, "Founded" TEXT, "Enrollment" TEXT)
| What year was Hartland College founded? | SELECT "Founded" FROM table_23907 WHERE "School" = 'Hartland College' | SELECT "Founded" FROM "table_23907" WHERE "School" = 'Hartland College' | 0.069336 |
CREATE TABLE table_203_224 (id DECIMAL, "title" TEXT, "year" DECIMAL, "channel" TEXT, "role" TEXT, "notes" TEXT)
| what television title did she perform in directly after loose women ? | SELECT "title" FROM table_203_224 WHERE id = (SELECT id FROM table_203_224 WHERE "title" = 'loose women') + 1 | SELECT "title" FROM "table_203_224" WHERE "id" = (SELECT "id" FROM "table_203_224" WHERE "title" = 'loose women') + 1 | 0.114258 |
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| how many patients are diagnosed with primary disease pituitary bleed and born before 2056? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2056" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "2056" > "demographic"."dob_year" AND "PITUITARY BLEED" = "demographic"."diagnosis" | 0.154297 |
CREATE TABLE table_name_91 (actor VARCHAR, character VARCHAR, soap_opera VARCHAR, duration VARCHAR)
| What actor has goede tijden, slechte tijden, as the soap opera, 11 years as the duration, with rosa gonzalez as the character? | SELECT actor FROM table_name_91 WHERE soap_opera = "goede tijden, slechte tijden" AND duration = "11 years" AND character = "rosa gonzalez" | SELECT "actor" FROM "table_name_91" WHERE "11 years" = "duration" AND "character" = "rosa gonzalez" AND "goede tijden, slechte tijden" = "soap_opera" | 0.145508 |
CREATE TABLE table_17675675_2 (tries_for VARCHAR, lost VARCHAR)
| With the given loss of 4, what was the number of tries? | SELECT COUNT(tries_for) FROM table_17675675_2 WHERE lost = "4" | SELECT COUNT("tries_for") FROM "table_17675675_2" WHERE "4" = "lost" | 0.066406 |
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE course (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 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_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 gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction 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 program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
| What are the PreMajor classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%PreMajor%' JOIN "program" ON "program"."name" LIKE '%CS-LSA%' AND "program"."program_id" = "program_course"."program_id" | 0.316406 |
CREATE TABLE table_name_81 (res VARCHAR, type VARCHAR, opponent VARCHAR)
| What was the resolution for KO opposing Cliff Beckett? | SELECT res FROM table_name_81 WHERE type = "ko" AND opponent = "cliff beckett" | SELECT "res" FROM "table_name_81" WHERE "cliff beckett" = "opponent" AND "ko" = "type" | 0.083984 |
CREATE TABLE journalist (journalist_ID INT, Name TEXT, Nationality TEXT, Age TEXT, Years_working INT)
CREATE TABLE news_report (journalist_ID INT, Event_ID INT, Work_Type TEXT)
CREATE TABLE event (Event_ID INT, Date TEXT, Venue TEXT, Name TEXT, Event_Attendance INT)
| Find the average age of journalists working on different role type, show the result with a bar chart, and list by the x-axis from low to high. | SELECT Work_Type, AVG(t1.Age) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type ORDER BY Work_Type | SELECT "Work_Type", AVG("t1"."Age") FROM "journalist" AS "t1" JOIN "news_report" AS "t2" ON "t1"."journalist_ID" = "t2"."journalist_ID" GROUP BY "t2"."Work_Type" ORDER BY "Work_Type" NULLS FIRST | 0.189453 |
CREATE TABLE table_18438494_3 (time VARCHAR, wrestler VARCHAR)
| What was the time for the match with Cena? | SELECT time FROM table_18438494_3 WHERE wrestler = "Cena" | SELECT "time" FROM "table_18438494_3" WHERE "Cena" = "wrestler" | 0.061523 |
CREATE TABLE table_2248784_4 (rank_asia INT)
| What is the smallest Asian rank? | SELECT MIN(rank_asia) FROM table_2248784_4 | SELECT MIN("rank_asia") FROM "table_2248784_4" | 0.044922 |
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE 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 Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
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 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 CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name 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 Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE 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 PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostsWithDeleted (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
| Gold Objective-C Badge Ranking in New Zealand. This query retrieves all the gold objective-c badge users and ranks them according to their gold badge date received. | SELECT ROW_NUMBER() OVER (ORDER BY b.Date), b.UserId, b.Date AS DateReceived, u.DisplayName FROM Users AS u, Badges AS b WHERE b.Name = 'swift' AND b.Class = 3 AND u.Id = b.UserId GROUP BY b.Date, b.UserId, u.DisplayName | SELECT ROW_NUMBER() OVER (ORDER BY "b"."Date" NULLS FIRST), "b"."UserId", "b"."Date" AS "DateReceived", "u"."DisplayName" FROM "Users" AS "u" JOIN "Badges" AS "b" ON "b"."Class" = 3 AND "b"."Name" = 'swift' AND "b"."UserId" = "u"."Id" GROUP BY "b"."Date", "b"."UserId", "u"."DisplayName" | 0.280273 |
CREATE TABLE table_72512 ("Round" FLOAT, "Pick #" TEXT, "Player" TEXT, "Position" TEXT, "Nationality" TEXT, "College/junior/club team ( league ) " TEXT)
| What is the pick number for round 2? | SELECT "Pick #" FROM table_72512 WHERE "Round" = '2' | SELECT "Pick #" FROM "table_72512" WHERE "Round" = '2' | 0.052734 |
CREATE TABLE table_8732 ("Game" FLOAT, "Date" TEXT, "Opponent" TEXT, "Score" TEXT, "Location" TEXT, "Record" TEXT)
| Who played against the Celtics when the final game score was 85-102? | SELECT "Opponent" FROM table_8732 WHERE "Score" = '85-102' | SELECT "Opponent" FROM "table_8732" WHERE "Score" = '85-102' | 0.058594 |
CREATE TABLE table_11959669_4 (team VARCHAR, date VARCHAR)
| Which team played on December 5? | SELECT team FROM table_11959669_4 WHERE date = "December 5" | SELECT "team" FROM "table_11959669_4" WHERE "December 5" = "date" | 0.063477 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
| how many patients of hispanic, or latino/puerto rican ethnicity are diagnosed with icd9 code 51889? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.icd9_code = "51889" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "51889" = "diagnoses"."icd9_code" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "HISPANIC/LATINO - PUERTO RICAN" = "demographic"."ethnicity" | 0.235352 |
CREATE TABLE member_of (facid DECIMAL, dno DECIMAL, appt_type TEXT)
CREATE TABLE course (cid TEXT, cname TEXT, credits DECIMAL, instructor DECIMAL, days TEXT, hours TEXT, dno DECIMAL)
CREATE TABLE gradeconversion (lettergrade TEXT, gradepoint DECIMAL)
CREATE TABLE department (dno DECIMAL, division TEXT, dname TEXT, room TEXT, building TEXT, dphone DECIMAL)
CREATE TABLE enrolled_in (stuid DECIMAL, cid TEXT, grade TEXT)
CREATE TABLE faculty (facid DECIMAL, lname TEXT, fname TEXT, rank TEXT, sex TEXT, phone DECIMAL, room TEXT, building TEXT)
CREATE TABLE student (stuid DECIMAL, lname TEXT, fname TEXT, age DECIMAL, sex TEXT, major DECIMAL, advisor DECIMAL, city_code TEXT)
CREATE TABLE minor_in (stuid DECIMAL, dno DECIMAL)
| What are the first names of students, ordered by age from greatest to least? | SELECT fname FROM student ORDER BY age DESC | SELECT "fname" FROM "student" ORDER BY "age" DESC NULLS LAST | 0.058594 |
CREATE TABLE table_33473 ("Home team" TEXT, "Home team score" TEXT, "Away team" TEXT, "Away team score" TEXT, "Venue" TEXT, "Crowd" FLOAT, "Date" TEXT)
| Who was the home team when Geelong was the away team? | SELECT "Home team" FROM table_33473 WHERE "Away team" = 'geelong' | SELECT "Home team" FROM "table_33473" WHERE "Away team" = 'geelong' | 0.06543 |
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| among patients having polyneuropathy in diabetes, how many of them were male? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Polyneuropathy in diabetes" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Polyneuropathy in diabetes" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "M" = "demographic"."gender" | 0.225586 |
CREATE TABLE table_50921 ("Episode" TEXT, "Air Date" TEXT, "Timeslot" TEXT, "18-49" TEXT, "Viewers" FLOAT)
| What is the timeslot for the episode with an 18-49 of 2.2/7? | SELECT "Timeslot" FROM table_50921 WHERE "18-49" = '2.2/7' | SELECT "Timeslot" FROM "table_50921" WHERE "18-49" = '2.2/7' | 0.058594 |
CREATE TABLE ENROLL (CLASS_CODE VARCHAR, STU_NUM INT, ENROLL_GRADE VARCHAR)
CREATE TABLE EMPLOYEE (EMP_NUM INT, EMP_LNAME VARCHAR, EMP_FNAME VARCHAR, EMP_INITIAL VARCHAR, EMP_JOBCODE VARCHAR, EMP_HIREDATE DATETIME, EMP_DOB DATETIME)
CREATE TABLE CLASS (CLASS_CODE VARCHAR, CRS_CODE VARCHAR, CLASS_SECTION VARCHAR, CLASS_TIME VARCHAR, CLASS_ROOM VARCHAR, PROF_NUM INT)
CREATE TABLE STUDENT (STU_NUM INT, STU_LNAME VARCHAR, STU_FNAME VARCHAR, STU_INIT VARCHAR, STU_DOB DATETIME, STU_HRS INT, STU_CLASS VARCHAR, STU_GPA FLOAT, STU_TRANSFER DECIMAL, DEPT_CODE VARCHAR, STU_PHONE VARCHAR, PROF_NUM INT)
CREATE TABLE COURSE (CRS_CODE VARCHAR, DEPT_CODE VARCHAR, CRS_DESCRIPTION VARCHAR, CRS_CREDIT FLOAT)
CREATE TABLE DEPARTMENT (DEPT_CODE VARCHAR, DEPT_NAME VARCHAR, SCHOOL_CODE VARCHAR, EMP_NUM INT, DEPT_ADDRESS VARCHAR, DEPT_EXTENSION VARCHAR)
CREATE TABLE PROFESSOR (EMP_NUM INT, DEPT_CODE VARCHAR, PROF_OFFICE VARCHAR, PROF_EXTENSION VARCHAR, PROF_HIGH_DEGREE VARCHAR)
| Show the number of courses for each instructor in a bar chart, and list x-axis from low to high order. | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME | SELECT "EMP_FNAME", COUNT("EMP_FNAME") FROM "CLASS" AS "T1" JOIN "EMPLOYEE" AS "T2" ON "T1"."PROF_NUM" = "T2"."EMP_NUM" JOIN "COURSE" AS "T3" ON "T1"."CRS_CODE" = "T3"."CRS_CODE" JOIN "PROFESSOR" AS "T4" ON "T2"."EMP_NUM" = "T4"."EMP_NUM" GROUP BY "EMP_FNAME" ORDER BY "EMP_FNAME" NULLS FIRST | 0.285156 |
CREATE TABLE table_name_38 (overall INT, round VARCHAR, pick__number VARCHAR)
| With Round 3 and Pick # over 10, what is the higher Overall number? | SELECT MAX(overall) FROM table_name_38 WHERE round = 3 AND pick__number > 10 | SELECT MAX("overall") FROM "table_name_38" WHERE "pick__number" > 10 AND "round" = 3 | 0.082031 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE 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 cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
| how many patients were prescribed with sodium chloride 0.9 % iv soln within the same hospital visit following the diagnosis of acute coronary syndrome - acute myocardial infarction (with st elevation), this year? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute coronary syndrome - acute myocardial infarction (with st elevation)' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'sodium chloride 0.9 % iv soln' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) AS t2 WHERE t1.diagnosistime < t2.drugstarttime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid | WITH "t2" AS (SELECT "medication"."drugstarttime", "patient"."patienthealthsystemstayid" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" WHERE "medication"."drugname" = 'sodium chloride 0.9 % iv soln' AND DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" JOIN "t2" AS "t2" ON "diagnosis"."diagnosistime" < "t2"."drugstarttime" AND "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" WHERE "diagnosis"."diagnosisname" = 'acute coronary syndrome - acute myocardial infarction (with st elevation)' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | 0.867188 |
CREATE TABLE table_68157 ("Year" FLOAT, "Competition" TEXT, "Venue" TEXT, "Position" TEXT, "Event" TEXT)
| What Venue is listed that has a Year smaller than 2005 and a Position of 10th (sf)? | SELECT "Venue" FROM table_68157 WHERE "Year" < '2005' AND "Position" = '10th (sf)' | SELECT "Venue" FROM "table_68157" WHERE "Position" = '10th (sf)' AND "Year" < '2005' | 0.082031 |
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 prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| provide the number of patients whose ethnicity is black/cape verdean and primary disease is aortic valve insuffiency\aortic valve replacement /sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" WHERE "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" = "demographic"."diagnosis" AND "BLACK/CAPE VERDEAN" = "demographic"."ethnicity" | 0.207031 |
CREATE TABLE table_66643 ("Tie no" TEXT, "Home team" TEXT, "Score" TEXT, "Away team" TEXT, "Attendance" TEXT)
| What is the tie no that has southport as the away team? | SELECT "Tie no" FROM table_66643 WHERE "Away team" = 'southport' | SELECT "Tie no" FROM "table_66643" WHERE "Away team" = 'southport' | 0.064453 |
CREATE TABLE table_525 ("Branding" TEXT, "Callsign" TEXT, "Ch. #" TEXT, "Power ( kW ) " TEXT, "Station Type" TEXT, "Location ( Transmitter site ) " TEXT)
| What is the station type of calbayog | SELECT "Station Type" FROM table_525 WHERE "Location (Transmitter site)" = 'Calbayog' | SELECT "Station Type" FROM "table_525" WHERE "Location (Transmitter site)" = 'Calbayog' | 0.084961 |
CREATE TABLE table_72941 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "Original U.S. air date" TEXT, "Prod. code" FLOAT, "Viewers ( millions ) " TEXT)
| Who was the directed for the episode titled 'twister: part 1'? | SELECT "Directed by" FROM table_72941 WHERE "Title" = 'Twister: Part 1' | SELECT "Directed by" FROM "table_72941" WHERE "Title" = 'Twister: Part 1' | 0.071289 |
CREATE TABLE table_name_51 (week_3_sept_8 VARCHAR, week_2_sept_2 VARCHAR)
| What is listed for the Week 3 Sept 8 that has a Week 2 Sept 2 of Florida State (2-0) (4)? | SELECT week_3_sept_8 FROM table_name_51 WHERE week_2_sept_2 = "florida state (2-0) (4)" | SELECT "week_3_sept_8" FROM "table_name_51" WHERE "florida state (2-0) (4)" = "week_2_sept_2" | 0.09082 |
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE 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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
| how many days have it been since the first stay of patient 002-34744 on this hospital visit in the ward 83? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '002-34744' AND patient.wardid = 83 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "patient"."unitadmittime")) FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '002-34744' AND "patient"."wardid" = 83 ORDER BY "patient"."unitadmittime" NULLS FIRST LIMIT 1 | 0.266602 |
CREATE TABLE manager (manager_id DECIMAL, name TEXT, country TEXT, working_year_starts TEXT, age DECIMAL, level DECIMAL)
CREATE TABLE railway_manage (railway_id DECIMAL, manager_id DECIMAL, from_year TEXT)
CREATE TABLE railway (railway_id DECIMAL, railway TEXT, builder TEXT, built TEXT, wheels TEXT, location TEXT, objectnumber TEXT)
CREATE TABLE train (train_id DECIMAL, train_num TEXT, name TEXT, from TEXT, arrival TEXT, railway_id DECIMAL)
| What are the names of managers in ascending order of level? | SELECT name FROM manager ORDER BY level | SELECT "name" FROM "manager" ORDER BY "level" NULLS FIRST | 0.055664 |
CREATE TABLE table_name_48 (margin_of_victory VARCHAR, runner_s__up VARCHAR)
| What was the margin of victory when the runner-up was Janet Coles? | SELECT margin_of_victory FROM table_name_48 WHERE runner_s__up = "janet coles" | SELECT "margin_of_victory" FROM "table_name_48" WHERE "janet coles" = "runner_s__up" | 0.082031 |
CREATE TABLE departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_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)
CREATE TABLE locations (LOCATION_ID DECIMAL, STREET_ADDRESS VARCHAR, POSTAL_CODE VARCHAR, CITY VARCHAR, STATE_PROVINCE VARCHAR, COUNTRY_ID VARCHAR)
CREATE TABLE regions (REGION_ID DECIMAL, REGION_NAME VARCHAR)
CREATE TABLE countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_ID DECIMAL)
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
| For those employees who did not have any job in the past, show me about the distribution of job_id and the average of department_id , and group by attribute job_id in a bar chart, and rank by the Y in asc. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) | SELECT "JOB_ID", AVG("DEPARTMENT_ID") FROM "employees" WHERE NOT "EMPLOYEE_ID" IN (SELECT "EMPLOYEE_ID" FROM "job_history") GROUP BY "JOB_ID" ORDER BY AVG("DEPARTMENT_ID") NULLS FIRST | 0.178711 |
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 diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE 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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
| how many days since patient 021-80293 was admitted in the icu? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-80293' AND patient.unitdischargetime IS NULL | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', "patient"."unitadmittime")) FROM "patient" WHERE "patient"."uniquepid" = '021-80293' AND "patient"."unitdischargetime" IS NULL | 0.181641 |
CREATE TABLE table_5695 ("Week 6 Oct 5" TEXT, "Week 7 Oct 12" TEXT, "Week 9 Oct 26" TEXT, "Week 10 Nov 2" TEXT, "Week 11 Nov 9" TEXT, "Week 13 Nov 23" TEXT, "Week 14 Nov 30" TEXT, "Week 15 ( Final ) Dec 7" TEXT)
| Which Week 13 Nov 23 has a Week 6 Oct 5 of oklahoma state (5-0)? | SELECT "Week 13 Nov 23" FROM table_5695 WHERE "Week 6 Oct 5" = 'oklahoma state (5-0)' | SELECT "Week 13 Nov 23" FROM "table_5695" WHERE "Week 6 Oct 5" = 'oklahoma state (5-0)' | 0.084961 |
CREATE TABLE Research_Outcomes (outcome_code VARCHAR, outcome_description VARCHAR)
CREATE TABLE Organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR)
CREATE TABLE Documents (document_id INT, document_type_code VARCHAR, grant_id INT, sent_date DATETIME, response_received_date DATETIME, other_details VARCHAR)
CREATE TABLE Grants (grant_id INT, organisation_id INT, grant_amount DECIMAL, grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR)
CREATE TABLE Research_Staff (staff_id INT, employer_organisation_id INT, staff_details VARCHAR)
CREATE TABLE Organisations (organisation_id INT, organisation_type VARCHAR, organisation_details VARCHAR)
CREATE TABLE Project_Outcomes (project_id INT, outcome_code VARCHAR, outcome_details VARCHAR)
CREATE TABLE Tasks (task_id INT, project_id INT, task_details VARCHAR, "eg Agree Objectives" VARCHAR)
CREATE TABLE Projects (project_id INT, organisation_id INT, project_details VARCHAR)
CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR)
CREATE TABLE Project_Staff (staff_id DOUBLE, project_id INT, role_code VARCHAR, date_from DATETIME, date_to DATETIME, other_details VARCHAR)
CREATE TABLE Staff_Roles (role_code VARCHAR, role_description VARCHAR)
| List the description of the outcomes for all projects, and count them by a pie chart | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description | SELECT "outcome_description", COUNT("outcome_description") FROM "Research_Outcomes" AS "T1" JOIN "Project_Outcomes" AS "T2" ON "T1"."outcome_code" = "T2"."outcome_code" GROUP BY "outcome_description" | 0.194336 |
CREATE TABLE table_67480 ("Name" TEXT, "Discovered" FLOAT, "Museum" TEXT, "Museum city" TEXT, "Discoverer" TEXT, "Formation" TEXT, "Location" TEXT)
| What is the name of the specimen that was discovered after 1987 and is in an Indianapolis, Indiana museum? | SELECT "Name" FROM table_67480 WHERE "Discovered" > '1987' AND "Museum city" = 'indianapolis, in' | SELECT "Name" FROM "table_67480" WHERE "Discovered" > '1987' AND "Museum city" = 'indianapolis, in' | 0.09668 |
CREATE TABLE table_63908 ("Rank" FLOAT, "Lane" FLOAT, "Athlete" TEXT, "Nationality" TEXT, "Time" FLOAT, "Notes" TEXT)
| What is the lowest time for Paulo Villar in lane 9? | SELECT MIN("Time") FROM table_63908 WHERE "Athlete" = 'paulo villar' AND "Lane" < '9' | SELECT MIN("Time") FROM "table_63908" WHERE "Athlete" = 'paulo villar' AND "Lane" < '9' | 0.084961 |
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 ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment 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 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 PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId 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 PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description 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 FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name 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 ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE CloseAsOffTopicReasonTypes (Id DECIMAL, IsUniversal BOOLEAN, InputTitle TEXT, MarkdownInputGuidance TEXT, MarkdownPostOwnerGuidance TEXT, MarkdownPrivilegedUserGuidance TEXT, MarkdownConcensusDescription TEXT, CreationDate TIME, CreationModeratorId DECIMAL, ApprovalDate TIME, ApprovalModeratorId DECIMAL, DeactivationDate TIME, DeactivationModeratorId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId 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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
| Select Count(*) From Users Grup By Age. | SELECT Jahr, SUM(Anzahl) AS Gesamt, MIN(Anzahl) AS minimal, MAX(Anzahl) AS maximal, AVG(Anzahl) AS Schnitt FROM (SELECT YEAR(CreationDate) AS Jahr, MONTH(CreationDate) AS Monat, COUNT(*) AS Anzahl FROM Users AS U1 GROUP BY YEAR(CreationDate), MONTH(CreationDate)) AS T_TAGESANMELDUNG GROUP BY Jahr ORDER BY Jahr | WITH "T_TAGESANMELDUNG" AS (SELECT MAX(1) AS "_" FROM "Users" AS "U1" GROUP BY YEAR("CreationDate"), MONTH("CreationDate")) SELECT "Jahr", SUM("Anzahl") AS "Gesamt", MIN("Anzahl") AS "minimal", MAX("Anzahl") AS "maximal", AVG("Anzahl") AS "Schnitt" FROM "T_TAGESANMELDUNG" AS "T_TAGESANMELDUNG" GROUP BY "Jahr" ORDER BY "Jahr" NULLS FIRST | 0.330078 |
CREATE TABLE table_80093 ("Index" TEXT, "Name" TEXT, "Talent Segment" TEXT, "Acting Segment" TEXT, "Overall Ranking" FLOAT, "Status" TEXT)
| What's the acting segment of lin peiqi's events that are eliminated? | SELECT "Acting Segment" FROM table_80093 WHERE "Status" = 'eliminated' AND "Name" = 'ζ佩ηͺ lin peiqi' | SELECT "Acting Segment" FROM "table_80093" WHERE "Name" = 'ζ佩ηͺ lin peiqi' AND "Status" = 'eliminated' | 0.098633 |
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
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 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 student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE 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 gsi (course_offering_id INT, student_id INT)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE 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)
| Can you tell me the PreMajor classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | SELECT DISTINCT "course"."department", "course"."name", "course"."number" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%PreMajor%' JOIN "program" ON "program"."name" LIKE '%CS-LSA%' AND "program"."program_id" = "program_course"."program_id" | 0.316406 |
CREATE TABLE table_21103 ("Name" TEXT, "Latitude" TEXT, "Longitude" TEXT, "Diameter ( km ) " TEXT, "Year named" FLOAT, "Name origin" TEXT)
| How many years have a longitude measure of 20.0e? | SELECT COUNT("Year named") FROM table_21103 WHERE "Longitude" = '20.0E' | SELECT COUNT("Year named") FROM "table_21103" WHERE "Longitude" = '20.0E' | 0.071289 |
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
CREATE TABLE CloseReasonTypes (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 Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE 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 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 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)
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 Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PendingFlags (Id DECIMAL, FlagTypeId DECIMAL, PostId DECIMAL, CreationDate TIME, CloseReasonTypeId DECIMAL, CloseAsOffTopicReasonTypeId DECIMAL, DuplicateOfQuestionId DECIMAL, BelongsOnBaseHostAddress TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name 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 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)
| Unanswered questions sorted by answered count. | SELECT p.Id AS "post_link", p.Score, p.AnswerCount, MAX(a.Score) AS BestAnswerScore, p.LastActivityDate FROM Posts AS p JOIN PostTypes AS pt ON pt.Id = p.PostTypeId JOIN Posts AS a ON a.ParentId = p.Id WHERE p.ClosedDate IS NULL AND pt.Name = 'Question' AND p.AcceptedAnswerId IS NULL AND p.Score >= 0 AND p.CommunityOwnedDate IS NULL AND p.CreationDate < DATEADD(DAY, -7, GETDATE()) GROUP BY p.Id, p.Score, p.AnswerCount, p.LastActivityDate, p.AcceptedAnswerId HAVING MAX(CASE WHEN (a.Score > 0 OR a.OwnerUserId = '##UserId##') THEN 1 ELSE 0 END) = 0 ORDER BY p.AnswerCount DESC, p.Score, p.LastActivityDate | SELECT "p"."Id" AS "post_link", "p"."Score", "p"."AnswerCount", MAX("a"."Score") AS "BestAnswerScore", "p"."LastActivityDate" FROM "Posts" AS "p" JOIN "Posts" AS "a" ON "a"."ParentId" = "p"."Id" JOIN "PostTypes" AS "pt" ON "p"."PostTypeId" = "pt"."Id" AND "pt"."Name" = 'Question' WHERE "p"."AcceptedAnswerId" IS NULL AND "p"."ClosedDate" IS NULL AND "p"."CommunityOwnedDate" IS NULL AND "p"."CreationDate" < DATEADD(DAY, -7, GETDATE()) AND "p"."Score" >= 0 GROUP BY "p"."Id", "p"."Score", "p"."AnswerCount", "p"."LastActivityDate", "p"."AcceptedAnswerId" HAVING MAX(CASE WHEN ("a"."OwnerUserId" = '##UserId##' OR "a"."Score" > 0) THEN 1 ELSE 0 END) = 0 ORDER BY "p"."AnswerCount" DESC NULLS LAST, "p"."Score" NULLS FIRST, "p"."LastActivityDate" NULLS FIRST | 0.739258 |
CREATE TABLE table_name_98 (builder VARCHAR, kanji VARCHAR)
| Which builder has the the kanji of ? | SELECT builder FROM table_name_98 WHERE kanji = "ζ" | SELECT "builder" FROM "table_name_98" WHERE "kanji" = "ζ" | 0.055664 |
CREATE TABLE table_name_37 (loaned_to VARCHAR, loan_expires VARCHAR, player VARCHAR)
| What shows for loaned to when the loan expires end of the season, Francis Jeffers is the player? | SELECT loaned_to FROM table_name_37 WHERE loan_expires = "end of the season" AND player = "francis jeffers" | SELECT "loaned_to" FROM "table_name_37" WHERE "end of the season" = "loan_expires" AND "francis jeffers" = "player" | 0.112305 |
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)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
| what is the number of government health insurance patients who had suture bladder laceration procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Suture bladder lacerat" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "Suture bladder lacerat" = "procedures"."short_title" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "Government" = "demographic"."insurance" | 0.237305 |
CREATE TABLE table_73652 ("No. in series" FLOAT, "No. in season" FLOAT, "Title" TEXT, "Directed by" TEXT, "Written by" TEXT, "U.S. viewers ( million ) " TEXT, "Original air date" TEXT)
| How many millions of people in the US watched when Kevin Bray was director? | SELECT "U.S. viewers (million)" FROM table_73652 WHERE "Directed by" = 'Kevin Bray' | SELECT "U.S. viewers (million)" FROM "table_73652" WHERE "Directed by" = 'Kevin Bray' | 0.083008 |
CREATE TABLE table_11677691_12 (school VARCHAR, hometown VARCHAR)
| What is the hometown of the players for placer, california | SELECT school FROM table_11677691_12 WHERE hometown = "Placer, California" | SELECT "school" FROM "table_11677691_12" WHERE "Placer, California" = "hometown" | 0.078125 |
CREATE TABLE table_38979 ("Game" FLOAT, "December" FLOAT, "Opponent" TEXT, "Score" TEXT, "Record" TEXT, "Points" FLOAT)
| Which December has Points of 38, and a Record of 18 6 2? | SELECT AVG("December") FROM table_38979 WHERE "Points" = '38' AND "Record" = '18β6β2' | SELECT AVG("December") FROM "table_38979" WHERE "Points" = '38' AND "Record" = '18β6β2' | 0.084961 |
CREATE TABLE table_23242968_1 (title VARCHAR, production_code VARCHAR)
| What was the name of the episode with a production code of 3ajn20? | SELECT title FROM table_23242968_1 WHERE production_code = "3AJN20" | SELECT "title" FROM "table_23242968_1" WHERE "3AJN20" = "production_code" | 0.071289 |
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE 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 intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| how many patients were diagnosed with s/p hip surgery and did not come to the hospital within the same month in the last year? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hip surgery' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hip surgery' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) AS t2 JOIN patient ON t2.uniquepid = patient.uniquepid WHERE t2.diagnosistime < patient.hospitaladmittime AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND DATETIME(t2.diagnosistime, 'start of month') = DATETIME(patient.hospitaladmittime, 'start of month')) | SELECT (SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "diagnosis" JOIN "patient" ON "diagnosis"."patientunitstayid" = "patient"."patientunitstayid" WHERE "diagnosis"."diagnosisname" = 's/p hip surgery' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) - (SELECT COUNT(DISTINCT "patient_2"."uniquepid") FROM "diagnosis" JOIN "patient" AS "patient_2" ON "diagnosis"."patientunitstayid" = "patient_2"."patientunitstayid" JOIN "patient" ON "diagnosis"."diagnosistime" < "patient"."hospitaladmittime" AND "patient"."uniquepid" = "patient_2"."uniquepid" AND DATETIME("diagnosis"."diagnosistime", 'start of month') = DATETIME("patient"."hospitaladmittime", 'start of month') AND DATETIME("patient"."hospitaladmittime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') WHERE "diagnosis"."diagnosisname" = 's/p hip surgery' AND DATETIME("diagnosis"."diagnosistime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | 0.99707 |
CREATE TABLE table_21690339_1 (_percentage_cut VARCHAR, gas_storage VARCHAR)
| What wast the percent cut for the nation with an 80% full gas storage? | SELECT _percentage_cut FROM table_21690339_1 WHERE gas_storage = "80% full" | SELECT "_percentage_cut" FROM "table_21690339_1" WHERE "80% full" = "gas_storage" | 0.079102 |
CREATE TABLE table_9809 ("Year" FLOAT, "Team" TEXT, "Co-Drivers" TEXT, "Class" TEXT, "Laps" FLOAT, "Pos." TEXT, "Class Pos." TEXT)
| What were the co-drivers in 2008? | SELECT "Co-Drivers" FROM table_9809 WHERE "Year" = '2008' | SELECT "Co-Drivers" FROM "table_9809" WHERE "Year" = '2008' | 0.057617 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.