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 treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
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 allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
| is any medicine prescribed to patient 032-24135 on the current hospital visit? | 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 = '032-24135' AND patient.hospitaldischargetime IS NULL)) | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."hospitaldischargetime" IS NULL AND "patient"."uniquepid" = '032-24135' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "medication" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "medication"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL | 0.53125 |
CREATE TABLE table_24552 ("District" TEXT, "Headquarters" TEXT, "Area ( km\\u00b2 ) " FLOAT, "Population ( 2011 ) " FLOAT, "Division" TEXT)
| What is the 2011 population if the headquarters is Chittorgarh? | SELECT "Population (2011)" FROM table_24552 WHERE "Headquarters" = 'Chittorgarh' | SELECT "Population (2011)" FROM "table_24552" WHERE "Headquarters" = 'Chittorgarh' | 0.080078 |
CREATE TABLE table_23417 ("Team" TEXT, "Truck ( s ) " TEXT, "#" FLOAT, "Driver ( s ) " TEXT, "Primary Sponsor ( s ) " TEXT, "Listed Owner ( s ) " TEXT, "Crew Chief" TEXT)
| What number truck is owned by Stephen Germain? | SELECT "#" FROM table_23417 WHERE "Listed Owner(s)" = 'Stephen Germain' | SELECT "#" FROM "table_23417" WHERE "Listed Owner(s)" = 'Stephen Germain' | 0.071289 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE procedures (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
| calculate the average age of male patients who had elective hospital admission. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_type = "ELECTIVE" | SELECT AVG("demographic"."age") FROM "demographic" WHERE "ELECTIVE" = "demographic"."admission_type" AND "M" = "demographic"."gender" | 0.129883 |
CREATE TABLE table_30831 ("Round" FLOAT, "Date" TEXT, "Grand Prix" TEXT, "Circuit" TEXT, "Pole Position" TEXT, "Fastest Lap" TEXT, "Race Winner" TEXT)
| Who won the race on June 26? | SELECT "Race Winner" FROM table_30831 WHERE "Date" = 'June 26' | SELECT "Race Winner" FROM "table_30831" WHERE "Date" = 'June 26' | 0.0625 |
CREATE TABLE table_53047 ("Date" TEXT, "Opponent" TEXT, "Home/Away" TEXT, "Field" TEXT, "Result" TEXT)
| On what date were the opponents the Bayhawks at a home game? | SELECT "Date" FROM table_53047 WHERE "Home/Away" = 'home' AND "Opponent" = 'bayhawks' | SELECT "Date" FROM "table_53047" WHERE "Home/Away" = 'home' AND "Opponent" = 'bayhawks' | 0.084961 |
CREATE TABLE shipments (shipment_id DECIMAL, order_id DECIMAL, invoice_number DECIMAL, shipment_tracking_number TEXT, shipment_date TIME, other_shipment_details TEXT)
CREATE TABLE order_items (order_item_id DECIMAL, product_id DECIMAL, order_id DECIMAL, order_item_status TEXT, order_item_details TEXT)
CREATE TABLE orders (order_id DECIMAL, customer_id DECIMAL, order_status TEXT, date_order_placed TIME, order_details TEXT)
CREATE TABLE customers (customer_id DECIMAL, customer_name TEXT, customer_details TEXT)
CREATE TABLE invoices (invoice_number DECIMAL, invoice_date TIME, invoice_details TEXT)
CREATE TABLE shipment_items (shipment_id DECIMAL, order_item_id DECIMAL)
CREATE TABLE products (product_id DECIMAL, product_name TEXT, product_details TEXT)
| Find the ids of orders which are shipped after 2000-01-01. | SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01" | SELECT "order_id" FROM "shipments" WHERE "2000-01-01" < "shipment_date" | 0.069336 |
CREATE TABLE table_72266 ("State" TEXT, "Preliminaries" TEXT, "Interview" TEXT, "Swimsuit" TEXT, "Evening Gown" TEXT, "Average" TEXT)
| what's the preliminaries where state is south dakota | SELECT "Preliminaries" FROM table_72266 WHERE "State" = 'South Dakota' | SELECT "Preliminaries" FROM "table_72266" WHERE "State" = 'South Dakota' | 0.070313 |
CREATE TABLE table_59184 ("Elimination" TEXT, "Wrestler" TEXT, "Eliminated by" TEXT, "Elimination Move" TEXT, "Time" TEXT)
| Which Wrestler has an Elimination of 5? | SELECT "Wrestler" FROM table_59184 WHERE "Elimination" = '5' | SELECT "Wrestler" FROM "table_59184" WHERE "Elimination" = '5' | 0.060547 |
CREATE TABLE table_76926 ("Taper" TEXT, "Large end" FLOAT, "Small end" FLOAT, "Length" FLOAT, "Taper/ ft" FLOAT, "Taper/ in" FLOAT, "Angle from center/\\u00b0" FLOAT)
| Which Taper/ft that has a Large end smaller than 0.5, and a Taper of #2? | SELECT MAX("Taper/ ft") FROM table_76926 WHERE "Large end" < '0.5' AND "Taper" = '#2' | SELECT MAX("Taper/ ft") FROM "table_76926" WHERE "Large end" < '0.5' AND "Taper" = '#2' | 0.084961 |
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
| when was last time that patient 7073 had the maximum arterial bp [diastolic] since 07/12/2104? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7073)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [diastolic]' AND d_items.linksto = 'chartevents') AND STRFTIME('%y-%m-%d', chartevents.charttime) >= '2104-07-12' ORDER BY chartevents.valuenum DESC, chartevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 7073 GROUP BY "hadm_id"), "_u_1" AS (SELECT "icustays"."icustay_id" FROM "icustays" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "icustays"."hadm_id" WHERE NOT "_u_0"."" IS NULL GROUP BY "icustay_id"), "_u_2" AS (SELECT "d_items"."itemid" FROM "d_items" WHERE "d_items"."label" = 'arterial bp [diastolic]' AND "d_items"."linksto" = 'chartevents' GROUP BY "itemid") SELECT "chartevents"."charttime" FROM "chartevents" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "chartevents"."icustay_id" LEFT JOIN "_u_2" AS "_u_2" ON "_u_2"."" = "chartevents"."itemid" WHERE NOT "_u_1"."" IS NULL AND NOT "_u_2"."" IS NULL AND STRFTIME('%y-%m-%d', "chartevents"."charttime") >= '2104-07-12' ORDER BY "chartevents"."valuenum" DESC NULLS LAST, "chartevents"."charttime" DESC NULLS LAST LIMIT 1 | 0.847656 |
CREATE TABLE table_10051 ("Place" TEXT, "Player" TEXT, "Country" TEXT, "Score" TEXT, "To par" TEXT)
| What is the country with a 66-70-69=205 score? | SELECT "Country" FROM table_10051 WHERE "Score" = '66-70-69=205' | SELECT "Country" FROM "table_10051" WHERE "Score" = '66-70-69=205' | 0.064453 |
CREATE TABLE table_30696 ("Reservoir" TEXT, "Basin" TEXT, "Location" TEXT, "Type" TEXT, "Height ( m ) " TEXT, "Length along the top ( m ) " TEXT, "Drainage basin ( km\\u00b2 ) " TEXT, "Reservoir surface ( ha ) " TEXT, "Volume ( hm\\u00b3 ) " TEXT)
| What is the volume when the resrvoir is Tanes? | SELECT "Volume (hm\u00b3)" FROM table_30696 WHERE "Reservoir" = 'Tanes' | SELECT "Volume (hm\u00b3)" FROM "table_30696" WHERE "Reservoir" = 'Tanes' | 0.071289 |
CREATE TABLE table_name_67 (site VARCHAR, date VARCHAR)
| What is SIte, when Date is 'September 13'? | SELECT site FROM table_name_67 WHERE date = "september 13" | SELECT "site" FROM "table_name_67" WHERE "date" = "september 13" | 0.0625 |
CREATE TABLE table_45685 ("Wicket" TEXT, "Runs" TEXT, "Batting partners" TEXT, "Batting team" TEXT, "Fielding team" TEXT, "Venue" TEXT, "Season" TEXT)
| In what season was 577 runs scored? | SELECT "Season" FROM table_45685 WHERE "Runs" = '577' | SELECT "Season" FROM "table_45685" WHERE "Runs" = '577' | 0.053711 |
CREATE TABLE table_name_96 (production_number VARCHAR, series VARCHAR, release_date VARCHAR)
| What is the Production Number of the Filmography in MM Series with a Release date of 1964-06-27? | SELECT production_number FROM table_name_96 WHERE series = "mm" AND release_date = "1964-06-27" | SELECT "production_number" FROM "table_name_96" WHERE "1964-06-27" = "release_date" AND "mm" = "series" | 0.100586 |
CREATE TABLE table_name_67 (socket VARCHAR, order_part_number VARCHAR)
| What is the socket for Order Part Number TMDTL68HAX5DM? | SELECT socket FROM table_name_67 WHERE order_part_number = "tmdtl68hax5dm" | SELECT "socket" FROM "table_name_67" WHERE "order_part_number" = "tmdtl68hax5dm" | 0.078125 |
CREATE TABLE pilot_record (record_id DECIMAL, pilot_id DECIMAL, aircraft_id DECIMAL, date TEXT)
CREATE TABLE pilot (pilot_id DECIMAL, pilot_name TEXT, rank DECIMAL, age DECIMAL, nationality TEXT, position TEXT, join_year DECIMAL, team TEXT)
CREATE TABLE aircraft (aircraft_id DECIMAL, order_year DECIMAL, manufacturer TEXT, model TEXT, fleet_series TEXT, powertrain TEXT, fuel_propulsion TEXT)
| What are the positions and teams of pilots? | SELECT position, team FROM pilot | SELECT "position", "team" FROM "pilot" | 0.037109 |
CREATE TABLE table_203_340 (id DECIMAL, "rank" DECIMAL, "airport" TEXT, "passengers handled" DECIMAL, "% change 2011 / 12" DECIMAL)
| how many passengers were handled in an airport in spain ? | SELECT SUM("passengers handled") FROM table_203_340 WHERE "airport" = 'spain' | SELECT SUM("passengers handled") FROM "table_203_340" WHERE "airport" = 'spain' | 0.077148 |
CREATE TABLE table_26681728_1 (location VARCHAR, score_final VARCHAR)
| Where did the event with a final score of 15.050 occur? | SELECT location FROM table_26681728_1 WHERE score_final = "15.050" | SELECT "location" FROM "table_26681728_1" WHERE "15.050" = "score_final" | 0.070313 |
CREATE TABLE table_name_74 (literary_tradition VARCHAR, language_s_ VARCHAR, year VARCHAR)
| What is the literary traidtion for the film in english in 2011? | SELECT literary_tradition FROM table_name_74 WHERE language_s_ = "english" AND year = 2011 | SELECT "literary_tradition" FROM "table_name_74" WHERE "english" = "language_s_" AND "year" = 2011 | 0.095703 |
CREATE TABLE table_204_445 (id DECIMAL, "year" DECIMAL, "competition" TEXT, "venue" TEXT, "position" TEXT, "notes" TEXT)
| what was the top position in which he finished ? | SELECT MIN("position") FROM table_204_445 | SELECT MIN("position") FROM "table_204_445" | 0.041992 |
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE 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 lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
| how many patients until 3 years ago were prescribed acetaminophen in the same hospital visit after the therapeutic antibacterials - empiric antibacterial coverage? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - empiric antibacterial coverage' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'acetaminophen' AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year')) AS t2 WHERE t1.treatmenttime < 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" = 'acetaminophen' AND DATETIME("medication"."drugstarttime") <= DATETIME(CURRENT_TIME(), '-3 year')) SELECT COUNT(DISTINCT "patient"."uniquepid") FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" JOIN "t2" AS "t2" ON "patient"."patienthealthsystemstayid" = "t2"."patienthealthsystemstayid" AND "t2"."drugstarttime" > "treatment"."treatmenttime" WHERE "treatment"."treatmentname" = 'therapeutic antibacterials - empiric antibacterial coverage' AND DATETIME("treatment"."treatmenttime") <= DATETIME(CURRENT_TIME(), '-3 year') | 0.773438 |
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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name 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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE 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 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 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE 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 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)
| select * from tags where tagname like '%%'. | SELECT TagName FROM Tags AS W | SELECT "TagName" FROM "Tags" AS "W" | 0.03418 |
CREATE TABLE table_203_653 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
| the average silver medal count of the first five ranked nations ? | SELECT AVG("silver") FROM table_203_653 WHERE "rank" <= 5 | SELECT AVG("silver") FROM "table_203_653" WHERE "rank" <= 5 | 0.057617 |
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE 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)
| Find out the long title of the procedure for the patient Stephanie Suchan. | SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Stephanie Suchan" | SELECT "procedures"."long_title" FROM "demographic" JOIN "procedures" ON "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "Stephanie Suchan" = "demographic"."name" | 0.165039 |
CREATE TABLE table_19476 ("Date Released" TEXT, "Polling institute" TEXT, "Socialist" TEXT, "Social Democratic" TEXT, "Peoples Party" TEXT, "Green-Communist" TEXT, "Left Bloc" TEXT, "Lead" TEXT)
| How many socialists correspond to a 7.5% People's Party? | SELECT COUNT("Socialist") FROM table_19476 WHERE "Peoples Party" = '7.5%' | SELECT COUNT("Socialist") FROM "table_19476" WHERE "Peoples Party" = '7.5%' | 0.073242 |
CREATE TABLE table_name_28 (grid INT, driver VARCHAR, laps VARCHAR)
| What is the number of the grid for Johnny Herbert with more than 52 laps? | SELECT SUM(grid) FROM table_name_28 WHERE driver = "johnny herbert" AND laps > 52 | SELECT SUM("grid") FROM "table_name_28" WHERE "driver" = "johnny herbert" AND "laps" > 52 | 0.086914 |
CREATE TABLE table_name_59 (game VARCHAR, opponents INT)
| What game did the Buffalo Bills' opponents earn more than 28 points? | SELECT game FROM table_name_59 WHERE opponents > 28 | SELECT "game" FROM "table_name_59" WHERE "opponents" > 28 | 0.055664 |
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)
| provide the number of patients whose marital status is widowed and diagnoses long title is osteoarthrosis, unspecified whether generalized or localized, site unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Osteoarthrosis, unspecified whether generalized or localized, site unspecified" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Osteoarthrosis, unspecified whether generalized or localized, site unspecified" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "WIDOWED" = "demographic"."marital_status" | 0.290039 |
CREATE TABLE table_18922 ("Year ( s ) " FLOAT, "Grand Final Television Commentator" TEXT, "Grand Final Dual Television Commentator" TEXT, "Spokesperson" TEXT, "Semi Final Television Commentator" TEXT, "Semi Final Dual Television Commentator" TEXT)
| Who was the spokesperson for France in 1970? | SELECT "Spokesperson" FROM table_18922 WHERE "Year(s)" = '1970' | SELECT "Spokesperson" FROM "table_18922" WHERE "Year(s)" = '1970' | 0.063477 |
CREATE TABLE Catalog_Structure (catalog_level_number INT, catalog_id INT, catalog_level_name VARCHAR)
CREATE TABLE Attribute_Definitions (attribute_id INT, attribute_name VARCHAR, attribute_data_type VARCHAR)
CREATE TABLE Catalogs (catalog_id INT, catalog_name VARCHAR, catalog_publisher VARCHAR, date_of_publication DATETIME, date_of_latest_revision DATETIME)
CREATE TABLE Catalog_Contents (catalog_entry_id INT, catalog_level_number INT, parent_entry_id INT, previous_entry_id INT, next_entry_id INT, catalog_entry_name VARCHAR, product_stock_number VARCHAR, price_in_dollars DOUBLE, price_in_euros DOUBLE, price_in_pounds DOUBLE, capacity VARCHAR, length VARCHAR, height VARCHAR, width VARCHAR)
CREATE TABLE Catalog_Contents_Additional_Attributes (catalog_entry_id INT, catalog_level_number INT, attribute_id INT, attribute_value VARCHAR)
| What are the name and level of catalog structure with level number between 5 and 1 Show bar chart, and display in ascending by the y-axis. | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_number | SELECT "catalog_level_name", "catalog_level_number" FROM "Catalog_Structure" WHERE "catalog_level_number" <= 10 AND "catalog_level_number" >= 5 ORDER BY "catalog_level_number" NULLS FIRST | 0.182617 |
CREATE TABLE table_name_54 (effic VARCHAR, avg_g VARCHAR)
| Avg/G of 2.7 is what effic? | SELECT effic FROM table_name_54 WHERE avg_g = 2.7 | SELECT "effic" FROM "table_name_54" WHERE "avg_g" = 2.7 | 0.053711 |
CREATE TABLE table_312 ("Player" TEXT, "Position" TEXT, "School" TEXT, "Hometown" TEXT, "College" TEXT)
| Which player is from Saguaro High School? | SELECT "Position" FROM table_312 WHERE "School" = 'Saguaro High School' | SELECT "Position" FROM "table_312" WHERE "School" = 'Saguaro High School' | 0.071289 |
CREATE TABLE table_46091 ("Country" TEXT, "Population ( July 2005 est. ) " FLOAT, "Land Area ( km\\u00b2 ) " FLOAT, "% of arable land ( 2005 est. ) " TEXT, "Arable Land ( km\\u00b2 ) " FLOAT, "Population Density ( pop per km\\u00b2 ) " FLOAT)
| What's the arable land for the population of 20,090,437? | SELECT MAX("Arable Land (km\u00b2)") FROM table_46091 WHERE "Population (July 2005 est.)" = '20,090,437' | SELECT MAX("Arable Land (km\u00b2)") FROM "table_46091" WHERE "Population (July 2005 est.)" = '20,090,437' | 0.103516 |
CREATE TABLE table_40549 ("Race" TEXT, "Pole position" TEXT, "Fastest lap" TEXT, "Most laps led" TEXT, "Winning driver" TEXT, "Winning team" TEXT, "Report" TEXT)
| What is Most Laps Led, when Winning Team is Chip Ganassi Racing, and when Fastest Lap is Marco Andretti? | SELECT "Most laps led" FROM table_40549 WHERE "Winning team" = 'chip ganassi racing' AND "Fastest lap" = 'marco andretti' | SELECT "Most laps led" FROM "table_40549" WHERE "Fastest lap" = 'marco andretti' AND "Winning team" = 'chip ganassi racing' | 0.120117 |
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 days of hospital stay is greater than 0 and diagnoses long title is asthma, unspecified type, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "0" AND diagnoses.long_title = "Asthma, unspecified type, unspecified" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "diagnoses" ON "Asthma, unspecified type, unspecified" = "diagnoses"."long_title" AND "demographic"."hadm_id" = "diagnoses"."hadm_id" WHERE "0" < "demographic"."days_stay" | 0.239258 |
CREATE TABLE table_4660 ("Date" TEXT, "Result" TEXT, "Score" TEXT, "Stadium" TEXT, "City" TEXT, "Crowd" FLOAT)
| What was the result of the match that took place in Perth, featuring a score of 48-12? | SELECT "Result" FROM table_4660 WHERE "Score" = '48-12' AND "City" = 'perth' | SELECT "Result" FROM "table_4660" WHERE "City" = 'perth' AND "Score" = '48-12' | 0.076172 |
CREATE TABLE table_9017 ("Verb" TEXT, "2 ( VF ) " TEXT, "2 ( F ) " TEXT, "3 ( F ) " TEXT, "2/3 ( P ) " TEXT)
| WHICH 3 (F) has a 2 (VF) of khetish? | SELECT "3 (F)" FROM table_9017 WHERE "2 (VF)" = 'তুই khetish' | SELECT "3 (F)" FROM "table_9017" WHERE "2 (VF)" = 'তুই khetish' | 0.061523 |
CREATE TABLE table_name_51 (season INT, races VARCHAR, wins VARCHAR)
| In what Season were then less than 3 Races with less than 1 Win? | SELECT AVG(season) FROM table_name_51 WHERE races < 3 AND wins < 1 | SELECT AVG("season") FROM "table_name_51" WHERE "races" < 3 AND "wins" < 1 | 0.072266 |
CREATE TABLE table_21260 ("Year" FLOAT, "Starts" FLOAT, "Wins" FLOAT, "Top 5" FLOAT, "Top 10" FLOAT, "Poles" FLOAT, "Avg. Start" TEXT, "Avg. Finish" TEXT, "Winnings" TEXT, "Position" TEXT, "Team ( s ) " TEXT)
| what is the team where winnings is $81,690? | SELECT "Team(s)" FROM table_21260 WHERE "Winnings" = '$81,690' | SELECT "Team(s)" FROM "table_21260" WHERE "Winnings" = '$81,690' | 0.0625 |
CREATE TABLE Products (Code INT, Name VARCHAR, Price DECIMAL, Manufacturer INT)
CREATE TABLE Manufacturers (Code INT, Name VARCHAR, Headquarter VARCHAR, Founder VARCHAR, Revenue FLOAT)
| For those records from the products and each product's manufacturer, give me the comparison about the sum of revenue over the name , and group by attribute name, order X-axis from high to low order. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | SELECT "T1"."Name", "T2"."Revenue" FROM "Products" AS "T1" JOIN "Manufacturers" AS "T2" ON "T1"."Manufacturer" = "T2"."Code" GROUP BY "T1"."Name" ORDER BY "T1"."Name" DESC NULLS LAST | 0.177734 |
CREATE TABLE table_14144 ("Manufacturer" TEXT, "Transmission" TEXT, "Engine Capacity" FLOAT, "Fuel Type" TEXT, "L/100km Urban ( Cold ) " FLOAT, "L/100km Extra-Urban" FLOAT, "L/100km Combined" FLOAT, "mpg-UK Urban ( Cold ) " FLOAT, "mpg-UK Extra-Urban" FLOAT, "mpg-UK Combined" FLOAT, "mpg-US Urban" FLOAT, "mpg-US Extra-Urban" FLOAT, "mpg-US Combined" FLOAT, "CO 2 g/km" FLOAT, "Green Rating" TEXT)
| What is the average L/100km urban value having an L/100km extraurban under 7.2, mpg combined in the UK under 39.8, l/100km combined over 7.9, and mpg combined in the US under 25.1? | SELECT AVG("L/100km Urban (Cold)") FROM table_14144 WHERE "L/100km Extra-Urban" < '7.2' AND "mpg-UK Combined" < '39.8' AND "L/100km Combined" > '7.9' AND "mpg-US Combined" < '25.1' | SELECT AVG("L/100km Urban (Cold)") FROM "table_14144" WHERE "L/100km Combined" > '7.9' AND "L/100km Extra-Urban" < '7.2' AND "mpg-UK Combined" < '39.8' AND "mpg-US Combined" < '25.1' | 0.177734 |
CREATE TABLE table_1300525_1 (traditional VARCHAR, area VARCHAR)
| What is the traditional way to write the name of the district who's area is 2331? | SELECT traditional FROM table_1300525_1 WHERE area = 2331 | SELECT "traditional" FROM "table_1300525_1" WHERE "area" = 2331 | 0.061523 |
CREATE TABLE table_22056184_1 (position VARCHAR, poles VARCHAR)
| Which positions are the poles 2? | SELECT position FROM table_22056184_1 WHERE poles = 2 | SELECT "position" FROM "table_22056184_1" WHERE "poles" = 2 | 0.057617 |
CREATE TABLE table_23996 ("Name" TEXT, "Completions" FLOAT, "Attempts" FLOAT, "Completion %" TEXT, "Yards" FLOAT, "Touchdowns" FLOAT, "Interceptions" FLOAT, "QB Rating" TEXT)
| How many touchdowns were scored when QB rating was 82.7? | SELECT MAX("Touchdowns") FROM table_23996 WHERE "QB Rating" = '82.7' | SELECT MAX("Touchdowns") FROM "table_23996" WHERE "QB Rating" = '82.7' | 0.068359 |
CREATE TABLE table_21466 ("Athlete" TEXT, "Event" TEXT, "Round of 64" TEXT, "Round of 32" TEXT, "Round of 16" TEXT, "Quarterfinals" TEXT)
| How many number of athletes were in round of 64 was llagostera Vives ( esp ) l 6 2, 3 6, 5 7? | SELECT COUNT("Athlete") FROM table_21466 WHERE "Round of 64" = 'Llagostera Vives ( ESP ) L 6–2, 3–6, 5–7' | SELECT COUNT("Athlete") FROM "table_21466" WHERE "Round of 64" = 'Llagostera Vives ( ESP ) L 6–2, 3–6, 5–7' | 0.104492 |
CREATE TABLE table_name_43 (record VARCHAR, location VARCHAR)
| Location of hemisfair arena had what record? | SELECT record FROM table_name_43 WHERE location = "hemisfair arena" | SELECT "record" FROM "table_name_43" WHERE "hemisfair arena" = "location" | 0.071289 |
CREATE TABLE table_25909 ("Episode" TEXT, "First broadcast" TEXT, "Seans team" TEXT, "Daves team" TEXT, "Scores" TEXT)
| In which episode is Sean's team made up of Krishnan Guru-Murthy and Vic Reeves? | SELECT "Episode" FROM table_25909 WHERE "Seans team" = 'Krishnan Guru-Murthy and Vic Reeves' | SELECT "Episode" FROM "table_25909" WHERE "Seans team" = 'Krishnan Guru-Murthy and Vic Reeves' | 0.091797 |
CREATE TABLE demographic (subject_id TEXT, hadm_id TEXT, name TEXT, marital_status TEXT, age TEXT, dob TEXT, gender TEXT, language TEXT, religion TEXT, admission_type TEXT, days_stay TEXT, insurance TEXT, ethnicity TEXT, expire_flag TEXT, admission_location TEXT, discharge_location TEXT, diagnosis TEXT, dod TEXT, dob_year TEXT, dod_year TEXT, admittime TEXT, dischtime TEXT, admityear TEXT)
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE 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)
| give me the number of pituitary bleed primary disease patients who have ou route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "PITUITARY BLEED" AND prescriptions.route = "OU" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "prescriptions" ON "OU" = "prescriptions"."route" AND "demographic"."hadm_id" = "prescriptions"."hadm_id" WHERE "PITUITARY BLEED" = "demographic"."diagnosis" | 0.225586 |
CREATE TABLE job_history (EMPLOYEE_ID DECIMAL, START_DATE DATE, END_DATE DATE, JOB_ID VARCHAR, DEPARTMENT_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 countries (COUNTRY_ID VARCHAR, COUNTRY_NAME VARCHAR, REGION_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 departments (DEPARTMENT_ID DECIMAL, DEPARTMENT_NAME VARCHAR, MANAGER_ID DECIMAL, LOCATION_ID DECIMAL)
CREATE TABLE jobs (JOB_ID VARCHAR, JOB_TITLE VARCHAR, MIN_SALARY DECIMAL, MAX_SALARY DECIMAL)
| For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and employee_id , and order FIRST_NAME in descending order. | SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC | SELECT "FIRST_NAME", "EMPLOYEE_ID" FROM "employees" WHERE NOT "DEPARTMENT_ID" IN (SELECT "DEPARTMENT_ID" FROM "departments" WHERE "MANAGER_ID" <= 200 AND "MANAGER_ID" >= 100) ORDER BY "FIRST_NAME" DESC NULLS LAST | 0.207031 |
CREATE TABLE table_name_76 (time VARCHAR, country VARCHAR)
| What time did the team from Ukraine have? | SELECT time FROM table_name_76 WHERE country = "ukraine" | SELECT "time" FROM "table_name_76" WHERE "country" = "ukraine" | 0.060547 |
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 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)
| how many patients with private insurance had procedure under icd9 code 8852? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "8852" | SELECT COUNT(DISTINCT "demographic"."subject_id") FROM "demographic" JOIN "procedures" ON "8852" = "procedures"."icd9_code" AND "demographic"."hadm_id" = "procedures"."hadm_id" WHERE "Private" = "demographic"."insurance" | 0.214844 |
CREATE TABLE table_76759 ("Player" TEXT, "Pos." TEXT, "Nationality" TEXT, "Team" TEXT, "Previous team" TEXT, "Years of NBA experience [a ]" FLOAT, "Career with the franchise [b ]" TEXT)
| How many years of NBA experience does the player who plays position g for the Portland Trail Blazers? | SELECT "Years of NBA experience [a ]" FROM table_76759 WHERE "Pos." = 'g' AND "Team" = 'portland trail blazers' | SELECT "Years of NBA experience [a ]" FROM "table_76759" WHERE "Pos." = 'g' AND "Team" = 'portland trail blazers' | 0.110352 |
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE Users (Id DECIMAL, Reputation DECIMAL, CreationDate TIME, DisplayName TEXT, LastAccessDate TIME, WebsiteUrl TEXT, Location TEXT, AboutMe TEXT, Views DECIMAL, UpVotes DECIMAL, DownVotes DECIMAL, ProfileImageUrl TEXT, EmailHash TEXT, AccountId DECIMAL)
CREATE TABLE 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 ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE Posts (Id DECIMAL, PostTypeId DECIMAL, AcceptedAnswerId DECIMAL, ParentId DECIMAL, CreationDate TIME, DeletionDate TIME, Score DECIMAL, ViewCount DECIMAL, Body TEXT, OwnerUserId DECIMAL, OwnerDisplayName TEXT, LastEditorUserId DECIMAL, LastEditorDisplayName TEXT, LastEditDate TIME, LastActivityDate TIME, Title TEXT, Tags TEXT, AnswerCount DECIMAL, CommentCount DECIMAL, FavoriteCount DECIMAL, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense TEXT)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE PostTags (PostId DECIMAL, TagId DECIMAL)
CREATE TABLE PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEdits (Id DECIMAL, PostId DECIMAL, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId DECIMAL, Comment TEXT, Text TEXT, Title TEXT, Tags TEXT, RevisionGUID other)
CREATE TABLE 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 PostHistoryTypes (Id DECIMAL, Name TEXT)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE Badges (Id DECIMAL, UserId DECIMAL, Name TEXT, Date TIME, Class DECIMAL, TagBased BOOLEAN)
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 ReviewTasks (Id DECIMAL, ReviewTaskTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId DECIMAL, PostId DECIMAL, SuggestedEditId DECIMAL, CompletedByReviewTaskId DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange 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 PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE ReviewTaskResultTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostLinks (Id DECIMAL, CreationDate TIME, PostId DECIMAL, RelatedPostId DECIMAL, LinkTypeId DECIMAL)
| Number of bounties with accepted answer depending on the day when bounty started. | WITH tmp AS (SELECT p.Id, p.AcceptedAnswerId AS Acc, Period = TIME_TO_STR(bs.CreationDate, '%W') FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8) SELECT Period, COUNT(*), COUNT(Acc), ROUND((COUNT(Acc)) * 100.0 / (COUNT(*)), 2) AS percentage FROM tmp GROUP BY Period ORDER BY Period | SELECT "Period", COUNT(*), COUNT("Acc"), ROUND(COUNT("Acc") * 100.0 / NULLIF(COUNT(*), 0), 2) AS "percentage" FROM "Posts" AS "p" JOIN "Votes" AS "bs" ON "bs"."PostId" = "p"."Id" AND "bs"."VoteTypeId" = 8 GROUP BY "Period" ORDER BY "Period" NULLS FIRST | 0.246094 |
CREATE TABLE prescriptions (subject_id TEXT, hadm_id TEXT, icustay_id TEXT, drug_type TEXT, drug TEXT, formulary_drug_cd TEXT, route TEXT, drug_dose TEXT)
CREATE TABLE lab (subject_id TEXT, hadm_id TEXT, itemid TEXT, charttime TEXT, flag TEXT, value_unit TEXT, label TEXT, fluid TEXT)
CREATE TABLE diagnoses (subject_id TEXT, hadm_id TEXT, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE 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 admission location and admission time of subject id 17519? | SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "17519" | SELECT "demographic"."admission_location", "demographic"."admittime" FROM "demographic" WHERE "17519" = "demographic"."subject_id" | 0.126953 |
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 PostTypes (Id DECIMAL, Name TEXT)
CREATE TABLE VoteTypes (Id DECIMAL, Name 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 Comments (Id DECIMAL, PostId DECIMAL, Score DECIMAL, Text TEXT, CreationDate TIME, UserDisplayName TEXT, UserId DECIMAL, ContentLicense TEXT)
CREATE TABLE Tags (Id DECIMAL, TagName TEXT, Count DECIMAL, ExcerptPostId DECIMAL, WikiPostId DECIMAL)
CREATE TABLE PostHistory (Id DECIMAL, PostHistoryTypeId DECIMAL, PostId DECIMAL, RevisionGUID other, CreationDate TIME, UserId DECIMAL, UserDisplayName TEXT, Comment TEXT, Text TEXT, ContentLicense TEXT)
CREATE TABLE ReviewTaskStates (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE 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 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 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 TagSynonyms (Id DECIMAL, SourceTagName TEXT, TargetTagName TEXT, CreationDate TIME, OwnerUserId DECIMAL, AutoRenameCount DECIMAL, LastAutoRename TIME, Score DECIMAL, ApprovedByUserId DECIMAL, ApprovalDate TIME)
CREATE TABLE PostFeedback (Id DECIMAL, PostId DECIMAL, IsAnonymous BOOLEAN, VoteTypeId DECIMAL, CreationDate TIME)
CREATE TABLE FlagTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE SuggestedEditVotes (Id DECIMAL, SuggestedEditId DECIMAL, UserId DECIMAL, VoteTypeId DECIMAL, CreationDate TIME, TargetUserId DECIMAL, TargetRepChange DECIMAL)
CREATE TABLE CloseReasonTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE ReviewRejectionReasons (Id DECIMAL, Name TEXT, Description TEXT, PostTypeId DECIMAL)
CREATE TABLE PostNoticeTypes (Id DECIMAL, ClassId DECIMAL, Name TEXT, Body TEXT, IsHidden BOOLEAN, Predefined BOOLEAN, PostNoticeDurationId DECIMAL)
CREATE TABLE Votes (Id DECIMAL, PostId DECIMAL, VoteTypeId DECIMAL, UserId DECIMAL, CreationDate TIME, BountyAmount DECIMAL)
CREATE TABLE ReviewTaskResults (Id DECIMAL, ReviewTaskId DECIMAL, ReviewTaskResultTypeId DECIMAL, CreationDate TIME, RejectionReasonId DECIMAL, Comment TEXT)
CREATE TABLE ReviewTaskTypes (Id DECIMAL, Name TEXT, Description TEXT)
CREATE TABLE PostNotices (Id DECIMAL, PostId DECIMAL, PostNoticeTypeId DECIMAL, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body TEXT, OwnerUserId DECIMAL, DeletionUserId DECIMAL)
CREATE TABLE 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 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)
| Top users with gold Angular badges. | SELECT UserId AS "user_link", COUNT(*) AS c FROM Badges WHERE Name IN ('angular') AND Class = 1 GROUP BY UserId ORDER BY COUNT(*) DESC LIMIT 100 | SELECT "UserId" AS "user_link", COUNT(*) AS "c" FROM "Badges" WHERE "Class" = 1 AND "Name" IN ('angular') GROUP BY "UserId" ORDER BY COUNT(*) DESC NULLS LAST LIMIT 100 | 0.163086 |
CREATE TABLE table_name_38 (Id VARCHAR)
| Name the 2010 for 2012 grand slam tournaments | SELECT 2010 FROM table_name_38 WHERE 2012 = "grand slam tournaments" | SELECT 2010 FROM "table_name_38" WHERE "grand slam tournaments" = 2012 | 0.068359 |
CREATE TABLE table_204_248 (id DECIMAL, "rank" DECIMAL, "nation" TEXT, "gold" DECIMAL, "silver" DECIMAL, "bronze" DECIMAL, "total" DECIMAL)
| what is the number of countries that had no gold medals ? | SELECT COUNT("nation") FROM table_204_248 WHERE "gold" = 0 | SELECT COUNT("nation") FROM "table_204_248" WHERE "gold" = 0 | 0.058594 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
| what was the name of the drug that was prescribed to patient 007-10135 within 2 days after antipyretics - acetaminophen in 11/last year? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135') AND treatment.treatmentname = 'antipyretics - acetaminophen' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', treatment.treatmenttime) = '11') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135') AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', medication.drugstarttime) = '11') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.drugstarttime AND DATETIME(t2.drugstarttime) BETWEEN DATETIME(t1.treatmenttime) AND DATETIME(t1.treatmenttime, '+2 day') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '007-10135' GROUP BY "patienthealthsystemstayid"), "t2" AS (SELECT "patient"."uniquepid", "medication"."drugname", "medication"."drugstarttime" FROM "medication" JOIN "patient" ON "medication"."patientunitstayid" = "patient"."patientunitstayid" LEFT JOIN "_u_0" AS "_u_1" ON "_u_1"."" = "patient"."patienthealthsystemstayid" WHERE DATETIME("medication"."drugstarttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_1"."" IS NULL AND STRFTIME('%m', "medication"."drugstarttime") = '11') SELECT "t2"."drugname" FROM "treatment" JOIN "patient" ON "patient"."patientunitstayid" = "treatment"."patientunitstayid" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" JOIN "t2" AS "t2" ON "patient"."uniquepid" = "t2"."uniquepid" AND "t2"."drugstarttime" > "treatment"."treatmenttime" AND DATETIME("t2"."drugstarttime") <= DATETIME("treatment"."treatmenttime", '+2 day') AND DATETIME("t2"."drugstarttime") >= DATETIME("treatment"."treatmenttime") WHERE "treatment"."treatmentname" = 'antipyretics - acetaminophen' AND DATETIME("treatment"."treatmenttime", 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT "_u_0"."" IS NULL AND STRFTIME('%m', "treatment"."treatmenttime") = '11' | 1.34082 |
CREATE TABLE table_name_87 (prime_mover VARCHAR, model VARCHAR)
| What is Prime Mover of Model FM CFA-16-4? | SELECT prime_mover FROM table_name_87 WHERE model = "fm cfa-16-4" | SELECT "prime_mover" FROM "table_name_87" WHERE "fm cfa-16-4" = "model" | 0.069336 |
CREATE TABLE table_name_22 (Id VARCHAR)
| What is the 1994 finish in the event that had a 1998 finish of 2R? | SELECT 1994 FROM table_name_22 WHERE 1998 = "2r" | SELECT 1994 FROM "table_name_22" WHERE "2r" = 1998 | 0.048828 |
CREATE TABLE table_name_82 (share VARCHAR, audience VARCHAR)
| What was the share when the audience was 3.944.000? | SELECT share FROM table_name_82 WHERE audience = "3.944.000" | SELECT "share" FROM "table_name_82" WHERE "3.944.000" = "audience" | 0.064453 |
CREATE TABLE table_77112 ("Player" TEXT, "Country" TEXT, "Year ( s ) won" TEXT, "Total" FLOAT, "To par" TEXT, "Finish" TEXT)
| What is Country, when Year(s) Won is '1962'? | SELECT "Country" FROM table_77112 WHERE "Year(s) won" = '1962' | SELECT "Country" FROM "table_77112" WHERE "Year(s) won" = '1962' | 0.0625 |
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 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 program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location 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 program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
| UKRAINE 152 is taught by who ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'UKRAINE' AND course.number = 152 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.offering_id | SELECT DISTINCT "instructor"."name" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" WHERE "course"."department" = 'UKRAINE' AND "course"."number" = 152 | 0.376953 |
CREATE TABLE Customers_Cards (card_id INT, customer_id INT, card_type_code VARCHAR, card_number VARCHAR, date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR)
CREATE TABLE Customers (customer_id INT, customer_first_name VARCHAR, customer_last_name VARCHAR, customer_address VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, other_customer_details VARCHAR)
CREATE TABLE Accounts (account_id INT, customer_id INT, account_name VARCHAR, other_account_details VARCHAR)
CREATE TABLE Financial_Transactions (transaction_id INT, previous_transaction_id INT, account_id INT, card_id INT, transaction_type VARCHAR, transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR, other_transaction_details VARCHAR)
| Show the transaction type and the number of transactions by a bar chart. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type | SELECT "transaction_type", COUNT(*) FROM "Financial_Transactions" GROUP BY "transaction_type" | 0.09082 |
CREATE TABLE table_name_13 (location VARCHAR, year VARCHAR, runner_up VARCHAR)
| Where in 1985 was tim mayotte runner up? | SELECT location FROM table_name_13 WHERE year > 1985 AND runner_up = "tim mayotte" | SELECT "location" FROM "table_name_13" WHERE "runner_up" = "tim mayotte" AND "year" > 1985 | 0.087891 |
CREATE TABLE airports (elevation INT, country VARCHAR)
| What is the maximum elevation of all airports in the country of Iceland? | SELECT MAX(elevation) FROM airports WHERE country = 'Iceland' | SELECT MAX("elevation") FROM "airports" WHERE "country" = 'Iceland' | 0.06543 |
CREATE TABLE PlaylistTrack (PlaylistId INT, TrackId INT)
CREATE TABLE InvoiceLine (InvoiceLineId INT, InvoiceId INT, TrackId INT, UnitPrice DECIMAL, Quantity INT)
CREATE TABLE Employee (EmployeeId INT, LastName VARCHAR, FirstName VARCHAR, Title VARCHAR, ReportsTo INT, BirthDate DATETIME, HireDate DATETIME, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR, Email VARCHAR)
CREATE TABLE Artist (ArtistId INT, Name VARCHAR)
CREATE TABLE Customer (CustomerId INT, FirstName VARCHAR, LastName VARCHAR, Company VARCHAR, Address VARCHAR, City VARCHAR, State VARCHAR, Country VARCHAR, PostalCode VARCHAR, Phone VARCHAR, Fax VARCHAR, Email VARCHAR, SupportRepId INT)
CREATE TABLE Playlist (PlaylistId INT, Name VARCHAR)
CREATE TABLE Album (AlbumId INT, Title VARCHAR, ArtistId INT)
CREATE TABLE Invoice (InvoiceId INT, CustomerId INT, InvoiceDate DATETIME, BillingAddress VARCHAR, BillingCity VARCHAR, BillingState VARCHAR, BillingCountry VARCHAR, BillingPostalCode VARCHAR, Total DECIMAL)
CREATE TABLE Genre (GenreId INT, Name VARCHAR)
CREATE TABLE MediaType (MediaTypeId INT, Name VARCHAR)
CREATE TABLE Track (TrackId INT, Name VARCHAR, AlbumId INT, MediaTypeId INT, GenreId INT, Composer VARCHAR, Milliseconds INT, Bytes INT, UnitPrice DECIMAL)
| Plot the number of phone by grouped by phone as a bar graph, could you list bar in descending order? | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC | SELECT "Phone", COUNT("Phone") FROM "Employee" GROUP BY "Phone" ORDER BY "Phone" DESC NULLS LAST | 0.09375 |
CREATE TABLE table_203_543 (id DECIMAL, "year" TEXT, "show" TEXT, "role" TEXT, "channel" TEXT, "extra" TEXT)
| list at least one show that she was on in 2012 . | SELECT "show" FROM table_203_543 WHERE "year" = 2012 | SELECT "show" FROM "table_203_543" WHERE "year" = 2012 | 0.052734 |
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 time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare 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 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 dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE flight_stop (flight_id INT, stop_number INT, stop_days TEXT, stop_airport TEXT, arrival_time INT, arrival_airline TEXT, arrival_flight_number INT, departure_time INT, departure_airline TEXT, departure_flight_number INT, stop_time INT)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
CREATE TABLE airline (airline_code VARCHAR, airline_name TEXT, note TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_name TEXT)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE code_description (code VARCHAR, description 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 city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
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 date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
| flights from KANSAS CITY to CLEVELAND on wednesday before 1700 | 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time < 1700 AND flight.flight_days = days.days_code) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code) AND CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'KANSAS CITY' 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" = 23 AND "date_day"."month_number" = 4 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" = 'KANSAS CITY' 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" AND "flight"."departure_time" < 1700 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" = 'CLEVELAND' | 0.74707 |
CREATE TABLE table_name_66 (against INT, played VARCHAR, drawn VARCHAR, points VARCHAR)
| What is the average against that has a drawn less than 7, points greater than 22, and 19 for the played? | SELECT AVG(against) FROM table_name_66 WHERE drawn < 7 AND points > 22 AND played = 19 | SELECT AVG("against") FROM "table_name_66" WHERE "drawn" < 7 AND "played" = 19 AND "points" > 22 | 0.09375 |
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 dual_carrier (main_airline VARCHAR, low_flight_number INT, high_flight_number INT, dual_airline VARCHAR, service_name TEXT)
CREATE TABLE month (month_number INT, month_name TEXT)
CREATE TABLE days (days_code VARCHAR, day_name VARCHAR)
CREATE TABLE compartment_class (compartment VARCHAR, class_type VARCHAR)
CREATE TABLE aircraft (aircraft_code VARCHAR, aircraft_description VARCHAR, manufacturer VARCHAR, basic_type VARCHAR, engines INT, propulsion VARCHAR, wide_body VARCHAR, wing_span INT, length INT, weight INT, capacity INT, pay_load INT, cruising_speed INT, range_miles INT, pressurized VARCHAR)
CREATE TABLE time_zone (time_zone_code TEXT, time_zone_name TEXT, hours_from_gmt INT)
CREATE TABLE equipment_sequence (aircraft_code_sequence VARCHAR, aircraft_code VARCHAR)
CREATE TABLE time_interval (period TEXT, begin_time INT, end_time INT)
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 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 class_of_service (booking_class VARCHAR, rank INT, class_description TEXT)
CREATE TABLE flight_fare (flight_id INT, fare_id INT)
CREATE TABLE city (city_code VARCHAR, city_name VARCHAR, state_code VARCHAR, country_name VARCHAR, time_zone_code VARCHAR)
CREATE TABLE restriction (restriction_code TEXT, advance_purchase INT, stopovers TEXT, saturday_stay_required TEXT, minimum_stay INT, maximum_stay INT, application TEXT, no_discounts TEXT)
CREATE TABLE fare (fare_id INT, from_airport VARCHAR, to_airport VARCHAR, fare_basis_code TEXT, fare_airline TEXT, restriction_code TEXT, one_direction_cost INT, round_trip_cost INT, round_trip_required VARCHAR)
CREATE TABLE flight_leg (flight_id INT, leg_number INT, leg_flight INT)
CREATE TABLE airport_service (city_code VARCHAR, airport_code VARCHAR, miles_distant INT, direction VARCHAR, minutes_distant INT)
CREATE TABLE state (state_code TEXT, state_name TEXT, country_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 code_description (code VARCHAR, description TEXT)
CREATE TABLE date_day (month_number INT, day_number INT, year INT, day_name VARCHAR)
CREATE TABLE food_service (meal_code TEXT, meal_number INT, compartment TEXT, meal_description VARCHAR)
CREATE TABLE ground_service (city_code TEXT, airport_code TEXT, transport_type TEXT, ground_fare INT)
| what airlines fly from BOSTON to WASHINGTON | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.airline_code = airline.airline_code AND flight.from_airport = AIRPORT_SERVICE_0.airport_code AND flight.to_airport = AIRPORT_SERVICE_1.airport_code | SELECT DISTINCT "airline"."airline_code" FROM "airline" JOIN "flight" ON "airline"."airline_code" = "flight"."airline_code" JOIN "airport_service" AS "AIRPORT_SERVICE_0" ON "AIRPORT_SERVICE_0"."airport_code" = "flight"."from_airport" JOIN "airport_service" AS "AIRPORT_SERVICE_1" ON "AIRPORT_SERVICE_1"."airport_code" = "flight"."to_airport" JOIN "city" AS "CITY_0" ON "AIRPORT_SERVICE_0"."city_code" = "CITY_0"."city_code" AND "CITY_0"."city_name" = 'BOSTON' JOIN "city" AS "CITY_1" ON "AIRPORT_SERVICE_1"."city_code" = "CITY_1"."city_code" AND "CITY_1"."city_name" = 'WASHINGTON' | 0.567383 |
CREATE TABLE Maintenance_Engineers (engineer_id VARCHAR, first_name VARCHAR, last_name VARCHAR)
CREATE TABLE Engineer_Visits (engineer_id VARCHAR)
| Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name. | SELECT T1.engineer_id, T1.first_name, T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id = T2.engineer_id GROUP BY T1.engineer_id ORDER BY COUNT(*) LIMIT 1 | SELECT "T1"."engineer_id", "T1"."first_name", "T1"."last_name" FROM "Maintenance_Engineers" AS "T1" JOIN "Engineer_Visits" AS "T2" ON "T1"."engineer_id" = "T2"."engineer_id" GROUP BY "T1"."engineer_id" ORDER BY COUNT(*) NULLS FIRST LIMIT 1 | 0.233398 |
CREATE TABLE table_13353 ("Parameter" TEXT, "Symbol" TEXT, "Best fit ( WMAP only ) " TEXT, "Best fit ( WMAP , extra parameter ) " TEXT, "Best fit ( all data ) " TEXT)
| What is the parameter when the best fit (WMAP only) is .9 .1, and a best fit (WMAP, extra parameter) is .92 .12? | SELECT "Parameter" FROM table_13353 WHERE "Best fit (WMAP only)" = '.9 ± .1' AND "Best fit (WMAP, extra parameter)" = '.92 ± .12' | SELECT "Parameter" FROM "table_13353" WHERE "Best fit (WMAP only)" = '.9 ± .1' AND "Best fit (WMAP, extra parameter)" = '.92 ± .12' | 0.12793 |
CREATE TABLE table_203_679 (id DECIMAL, "part" TEXT, "number" TEXT, "first public release date ( first edition ) " DECIMAL, "latest public release date ( edition ) " DECIMAL, "latest amendment" TEXT, "title" TEXT, "description" TEXT)
| what is number of parts that received their latest amendment before 2010 ? | SELECT COUNT("part") FROM table_203_679 WHERE "latest amendment" < 2010 | SELECT COUNT("part") FROM "table_203_679" WHERE "latest amendment" < 2010 | 0.071289 |
CREATE TABLE Document_Locations (Document_ID INT, Location_Code CHAR, Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME)
CREATE TABLE All_Documents (Document_ID INT, Date_Stored DATETIME, Document_Type_Code CHAR, Document_Name CHAR, Document_Description CHAR, Other_Details VARCHAR)
CREATE TABLE Roles (Role_Code CHAR, Role_Name VARCHAR, Role_Description VARCHAR)
CREATE TABLE Ref_Locations (Location_Code CHAR, Location_Name VARCHAR, Location_Description VARCHAR)
CREATE TABLE Documents_to_be_Destroyed (Document_ID INT, Destruction_Authorised_by_Employee_ID INT, Destroyed_by_Employee_ID INT, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR)
CREATE TABLE Employees (Employee_ID INT, Role_Code CHAR, Employee_Name VARCHAR, Gender_MFU CHAR, Date_of_Birth DATETIME, Other_Details VARCHAR)
CREATE TABLE Ref_Calendar (Calendar_Date DATETIME, Day_Number INT)
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR, Document_Type_Name VARCHAR, Document_Type_Description VARCHAR)
| Show the number of documents in different ending date and group by ending date with a line chart, and display in desc by the X. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To ORDER BY Date_in_Locaton_To DESC | SELECT "Date_in_Locaton_To", COUNT("Date_in_Locaton_To") FROM "Document_Locations" GROUP BY "Date_in_Locaton_To" ORDER BY "Date_in_Locaton_To" DESC NULLS LAST | 0.154297 |
CREATE TABLE table_name_31 (electorate VARCHAR, member VARCHAR, state VARCHAR, party VARCHAR)
| Which Electorate has a State of qld, a Party of national, and a Member of hon evan adermann? | SELECT electorate FROM table_name_31 WHERE state = "qld" AND party = "national" AND member = "hon evan adermann" | SELECT "electorate" FROM "table_name_31" WHERE "hon evan adermann" = "member" AND "national" = "party" AND "qld" = "state" | 0.119141 |
CREATE TABLE table_42569 ("Date" TEXT, "Home captain" TEXT, "Away captain" TEXT, "Venue" TEXT, "Result" TEXT)
| Who was the Away Captain when the Home Captain was Joe Darling at Melbourne Cricket Ground? | SELECT "Away captain" FROM table_42569 WHERE "Venue" = 'melbourne cricket ground' AND "Home captain" = 'joe darling' | SELECT "Away captain" FROM "table_42569" WHERE "Home captain" = 'joe darling' AND "Venue" = 'melbourne cricket ground' | 0.115234 |
CREATE TABLE table_27683516_3 (date_of_appointment VARCHAR, date_of_vacancy VARCHAR)
| What is the date of appointment when the date of vacancy is 24 november 2010? | SELECT date_of_appointment FROM table_27683516_3 WHERE date_of_vacancy = "24 November 2010" | SELECT "date_of_appointment" FROM "table_27683516_3" WHERE "24 November 2010" = "date_of_vacancy" | 0.094727 |
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
| when was the last time that patient 81461 had the chloride minimum value since 12/2105? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride') AND STRFTIME('%y-%m', labevents.charttime) >= '2105-12' ORDER BY labevents.valuenum, labevents.charttime DESC LIMIT 1 | WITH "_u_0" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 81461 GROUP BY "hadm_id"), "_u_1" AS (SELECT "d_labitems"."itemid" FROM "d_labitems" WHERE "d_labitems"."label" = 'chloride' GROUP BY "itemid") SELECT "labevents"."charttime" FROM "labevents" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "labevents"."hadm_id" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "labevents"."itemid" WHERE NOT "_u_0"."" IS NULL AND NOT "_u_1"."" IS NULL AND STRFTIME('%y-%m', "labevents"."charttime") >= '2105-12' ORDER BY "labevents"."valuenum" NULLS FIRST, "labevents"."charttime" DESC NULLS LAST LIMIT 1 | 0.608398 |
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 patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE lab (labid DECIMAL, patientunitstayid DECIMAL, labname TEXT, labresult DECIMAL, labresulttime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime TIME)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE microlab (microlabid DECIMAL, patientunitstayid DECIMAL, culturesite TEXT, organism TEXT, culturetakentime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
| did patient 013-38992 have an allergic reaction to anything in 2105? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-38992')) AND STRFTIME('%y', allergy.allergytime) = '2105' | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '013-38992' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid") SELECT COUNT(*) > 0 FROM "allergy" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "allergy"."patientunitstayid" WHERE NOT "_u_1"."" IS NULL AND STRFTIME('%y', "allergy"."allergytime") = '2105' | 0.532227 |
CREATE TABLE table_65670 ("Name" TEXT, "Gain" FLOAT, "Loss" FLOAT, "Long" FLOAT, "Avg/G" FLOAT)
| What is the lowest gain that has toben opurum as the name, with an avg/g less than 54.1? | SELECT MIN("Gain") FROM table_65670 WHERE "Name" = 'toben opurum' AND "Avg/G" < '54.1' | SELECT MIN("Gain") FROM "table_65670" WHERE "Avg/G" < '54.1' AND "Name" = 'toben opurum' | 0.085938 |
CREATE TABLE table_name_9 (record VARCHAR, date VARCHAR)
| What was the record for the game on April 9, 2008? | SELECT record FROM table_name_9 WHERE date = "april 9, 2008" | SELECT "record" FROM "table_name_9" WHERE "april 9, 2008" = "date" | 0.064453 |
CREATE TABLE student (stu_num DECIMAL, stu_lname TEXT, stu_fname TEXT, stu_init TEXT, stu_dob TIME, stu_hrs DECIMAL, stu_class TEXT, stu_gpa DECIMAL, stu_transfer DECIMAL, dept_code TEXT, stu_phone TEXT, prof_num DECIMAL)
CREATE TABLE employee (emp_num DECIMAL, emp_lname TEXT, emp_fname TEXT, emp_initial TEXT, emp_jobcode TEXT, emp_hiredate TIME, emp_dob TIME)
CREATE TABLE department (dept_code TEXT, dept_name TEXT, school_code TEXT, emp_num DECIMAL, dept_address TEXT, dept_extension TEXT)
CREATE TABLE class (class_code TEXT, crs_code TEXT, class_section TEXT, class_time TEXT, class_room TEXT, prof_num DECIMAL)
CREATE TABLE course (crs_code TEXT, dept_code TEXT, crs_description TEXT, crs_credit DECIMAL)
CREATE TABLE professor (emp_num DECIMAL, dept_code TEXT, prof_office TEXT, prof_extension TEXT, prof_high_degree TEXT)
CREATE TABLE enroll (class_code TEXT, stu_num DECIMAL, enroll_grade TEXT)
| What is the total number of professors with a Ph.D. ? | SELECT COUNT(*) FROM professor WHERE prof_high_degree = 'Ph.D.' | SELECT COUNT(*) FROM "professor" WHERE "prof_high_degree" = 'Ph.D.' | 0.06543 |
CREATE TABLE table_name_62 (Id VARCHAR)
| What is the 2011 value that has a 2r in 2008 and a 4r in 2012? | SELECT 2011 FROM table_name_62 WHERE 2008 = "2r" AND 2012 = "4r" | SELECT 2011 FROM "table_name_62" WHERE "2r" = 2008 AND "4r" = 2012 | 0.064453 |
CREATE TABLE prescriptions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, startdate TIME, enddate TIME, drug TEXT, dose_val_rx TEXT, dose_unit_rx TEXT, route TEXT)
CREATE TABLE admissions (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, admittime TIME, dischtime TIME, admission_type TEXT, admission_location TEXT, discharge_location TEXT, insurance TEXT, language TEXT, marital_status TEXT, ethnicity TEXT, age DECIMAL)
CREATE TABLE d_labitems (row_id DECIMAL, itemid DECIMAL, label TEXT)
CREATE TABLE outputevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, value DECIMAL)
CREATE TABLE d_icd_procedures (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE patients (row_id DECIMAL, subject_id DECIMAL, gender TEXT, dob TIME, dod TIME)
CREATE TABLE diagnoses_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
CREATE TABLE microbiologyevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, charttime TIME, spec_type_desc TEXT, org_name TEXT)
CREATE TABLE inputevents_cv (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, charttime TIME, itemid DECIMAL, amount DECIMAL)
CREATE TABLE labevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE d_icd_diagnoses (row_id DECIMAL, icd9_code TEXT, short_title TEXT, long_title TEXT)
CREATE TABLE d_items (row_id DECIMAL, itemid DECIMAL, label TEXT, linksto TEXT)
CREATE TABLE transfers (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, eventtype TEXT, careunit TEXT, wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE chartevents (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, itemid DECIMAL, charttime TIME, valuenum DECIMAL, valueuom TEXT)
CREATE TABLE cost (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, event_type TEXT, event_id DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE icustays (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icustay_id DECIMAL, first_careunit TEXT, last_careunit TEXT, first_wardid DECIMAL, last_wardid DECIMAL, intime TIME, outtime TIME)
CREATE TABLE procedures_icd (row_id DECIMAL, subject_id DECIMAL, hadm_id DECIMAL, icd9_code TEXT, charttime TIME)
| had patient 2536 had a enterostomy nec? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'enterostomy nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2536) | WITH "_u_1" AS (SELECT "admissions"."hadm_id" FROM "admissions" WHERE "admissions"."subject_id" = 2536 GROUP BY "hadm_id") SELECT COUNT(*) > 0 FROM "procedures_icd" JOIN "d_icd_procedures" ON "d_icd_procedures"."icd9_code" = "procedures_icd"."icd9_code" AND "d_icd_procedures"."short_title" = 'enterostomy nec' LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "procedures_icd"."hadm_id" WHERE NOT "_u_1"."" IS NULL | 0.397461 |
CREATE TABLE table_4984 ("Res." TEXT, "Record" TEXT, "Opponent" TEXT, "Method" TEXT, "Event" TEXT, "Round" FLOAT, "Time" TEXT, "Location" TEXT)
| How did he win with a time of 0:38? | SELECT "Method" FROM table_4984 WHERE "Time" = '0:38' | SELECT "Method" FROM "table_4984" WHERE "Time" = '0:38' | 0.053711 |
CREATE TABLE table_203_221 (id DECIMAL, "name" TEXT, "nationality" TEXT, "matches played" DECIMAL, "goals scored" DECIMAL, "notes" TEXT)
| what is the total number of matches played by brazilians for melbourne ? | SELECT SUM("matches played") FROM table_203_221 WHERE "nationality" = 'brazil' | SELECT SUM("matches played") FROM "table_203_221" WHERE "nationality" = 'brazil' | 0.078125 |
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
| Who is the teacher of ENDODONT 661 this Summer ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ENDODONT' AND course.number = 661 AND semester.semester = 'Summer' AND semester.year = 2016 | SELECT DISTINCT "instructor"."name" FROM "course" JOIN "course_offering" ON "course"."course_id" = "course_offering"."course_id" JOIN "offering_instructor" ON "course_offering"."offering_id" = "offering_instructor"."offering_id" JOIN "semester" ON "course_offering"."semester" = "semester"."semester_id" AND "semester"."semester" = 'Summer' AND "semester"."year" = 2016 JOIN "instructor" ON "instructor"."instructor_id" = "offering_instructor"."instructor_id" WHERE "course"."department" = 'ENDODONT' AND "course"."number" = 661 | 0.515625 |
CREATE TABLE wine (no DECIMAL, grape TEXT, winery TEXT, appelation TEXT, state TEXT, name TEXT, year DECIMAL, price DECIMAL, score DECIMAL, cases DECIMAL, drink TEXT)
CREATE TABLE grapes (id DECIMAL, grape TEXT, color TEXT)
CREATE TABLE appellations (no DECIMAL, appelation TEXT, county TEXT, state TEXT, area TEXT, isava TEXT)
| Find the white grape used to produce wines with scores above 90. | SELECT DISTINCT T1.grape FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape WHERE T1.color = "White" AND T2.score > 90 | SELECT DISTINCT "T1"."grape" FROM "grapes" AS "T1" JOIN "wine" AS "T2" ON "T1"."grape" = "T2"."grape" AND "T2"."score" > 90 WHERE "T1"."color" = "White" | 0.148438 |
CREATE TABLE diagnosis (diagnosisid DECIMAL, patientunitstayid DECIMAL, diagnosisname TEXT, diagnosistime TIME, icd9code TEXT)
CREATE TABLE allergy (allergyid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, allergyname TEXT, allergytime TIME)
CREATE TABLE medication (medicationid DECIMAL, patientunitstayid DECIMAL, drugname TEXT, dosage TEXT, routeadmin TEXT, drugstarttime TIME, drugstoptime TIME)
CREATE TABLE vitalperiodic (vitalperiodicid DECIMAL, patientunitstayid DECIMAL, temperature DECIMAL, sao2 DECIMAL, heartrate DECIMAL, respiration DECIMAL, systemicsystolic DECIMAL, systemicdiastolic DECIMAL, systemicmean DECIMAL, observationtime TIME)
CREATE TABLE patient (uniquepid TEXT, patienthealthsystemstayid DECIMAL, patientunitstayid DECIMAL, gender TEXT, age TEXT, ethnicity TEXT, hospitalid DECIMAL, wardid DECIMAL, admissionheight DECIMAL, admissionweight DECIMAL, dischargeweight DECIMAL, hospitaladmittime TIME, hospitaladmitsource TEXT, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus TEXT)
CREATE TABLE intakeoutput (intakeoutputid DECIMAL, patientunitstayid DECIMAL, cellpath TEXT, celllabel TEXT, cellvaluenumeric DECIMAL, intakeoutputtime TIME)
CREATE TABLE cost (costid DECIMAL, uniquepid TEXT, patienthealthsystemstayid DECIMAL, eventtype TEXT, eventid DECIMAL, chargetime TIME, cost DECIMAL)
CREATE TABLE treatment (treatmentid DECIMAL, patientunitstayid DECIMAL, treatmentname TEXT, treatmenttime 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)
| what are the changes in anion gap of patient 002-70965 measured at 2102-03-10 11:20:00 compared to the value measured at 2102-03-10 02:55:00? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-70965')) AND lab.labname = 'anion gap' AND lab.labresulttime = '2102-03-10 11:20:00') - (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-70965')) AND lab.labname = 'anion gap' AND lab.labresulttime = '2102-03-10 02:55:00') | WITH "_u_0" AS (SELECT "patient"."patienthealthsystemstayid" FROM "patient" WHERE "patient"."uniquepid" = '002-70965' GROUP BY "patienthealthsystemstayid"), "_u_1" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_0"."" IS NULL GROUP BY "patientunitstayid"), "_u_4" AS (SELECT "patient"."patientunitstayid" FROM "patient" LEFT JOIN "_u_0" AS "_u_3" ON "_u_3"."" = "patient"."patienthealthsystemstayid" WHERE NOT "_u_3"."" IS NULL GROUP BY "patientunitstayid") SELECT (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_1" AS "_u_1" ON "_u_1"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'anion gap' AND "lab"."labresulttime" = '2102-03-10 11:20:00' AND NOT "_u_1"."" IS NULL) - (SELECT "lab"."labresult" FROM "lab" LEFT JOIN "_u_4" AS "_u_4" ON "_u_4"."" = "lab"."patientunitstayid" WHERE "lab"."labname" = 'anion gap' AND "lab"."labresulttime" = '2102-03-10 02:55:00' AND NOT "_u_4"."" IS NULL) | 0.980469 |
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 gsi (course_offering_id INT, student_id INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college 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 program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE 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 jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip 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 ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
| Of these classes , which do n't have lab sessions ? | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' | SELECT DISTINCT "name", "number" FROM "course" WHERE "department" = 'EECS' AND "has_lab" = 'N' | 0.091797 |
CREATE TABLE table_203_413 (id DECIMAL, "rank" TEXT, "city" TEXT, "population" DECIMAL, "area\ ( km2 ) " DECIMAL, "density\ ( inhabitants/km2 ) " DECIMAL, "altitude\ ( mslm ) " DECIMAL)
| which communes have a population above 30,000 ? | SELECT "city" FROM table_203_413 WHERE "population" > 30000 | SELECT "city" FROM "table_203_413" WHERE "population" > 30000 | 0.05957 |
CREATE TABLE area (course_id INT, area VARCHAR)
CREATE TABLE program (program_id INT, name VARCHAR, college VARCHAR, introduction VARCHAR)
CREATE TABLE course_prerequisite (pre_course_id INT, course_id INT)
CREATE TABLE course_offering (offering_id INT, course_id INT, semester INT, section_number INT, start_time TIME, end_time TIME, monday VARCHAR, tuesday VARCHAR, wednesday VARCHAR, thursday VARCHAR, friday VARCHAR, saturday VARCHAR, sunday VARCHAR, has_final_project VARCHAR, has_final_exam VARCHAR, textbook VARCHAR, class_address VARCHAR, allow_audit VARCHAR)
CREATE TABLE semester (semester_id INT, semester VARCHAR, year INT)
CREATE TABLE ta (campus_job_id INT, student_id INT, location VARCHAR)
CREATE TABLE gsi (course_offering_id INT, student_id INT)
CREATE TABLE program_course (program_id INT, course_id INT, workload INT, category VARCHAR)
CREATE TABLE comment_instructor (instructor_id INT, student_id INT, score INT, comment_text VARCHAR)
CREATE TABLE student_record (student_id INT, course_id INT, semester INT, grade VARCHAR, how VARCHAR, transfer_source VARCHAR, earn_credit VARCHAR, repeat_term VARCHAR, test_id VARCHAR)
CREATE TABLE requirement (requirement_id INT, requirement VARCHAR, college VARCHAR)
CREATE TABLE course_tags_count (course_id INT, clear_grading INT, pop_quiz INT, group_projects INT, inspirational INT, long_lectures INT, extra_credit INT, few_tests INT, good_feedback INT, tough_tests INT, heavy_papers INT, cares_for_students INT, heavy_assignments INT, respected INT, participation INT, heavy_reading INT, tough_grader INT, hilarious INT, would_take_again INT, good_lecture INT, no_skip INT)
CREATE TABLE course (course_id INT, name VARCHAR, department VARCHAR, number VARCHAR, credits VARCHAR, advisory_requirement VARCHAR, enforced_requirement VARCHAR, description VARCHAR, num_semesters INT, num_enrolled INT, has_discussion VARCHAR, has_lab VARCHAR, has_projects VARCHAR, has_exams VARCHAR, num_reviews INT, clarity_score INT, easiness_score INT, helpfulness_score INT)
CREATE TABLE student (student_id INT, lastname VARCHAR, firstname VARCHAR, program_id INT, declare_major VARCHAR, total_credit INT, total_gpa FLOAT, entered_as VARCHAR, admit_term INT, predicted_graduation_semester INT, degree VARCHAR, minor VARCHAR, internship VARCHAR)
CREATE TABLE instructor (instructor_id INT, name VARCHAR, uniqname VARCHAR)
CREATE TABLE program_requirement (program_id INT, category VARCHAR, min_credit INT, additional_req VARCHAR)
CREATE TABLE jobs (job_id INT, job_title VARCHAR, description VARCHAR, requirement VARCHAR, city VARCHAR, state VARCHAR, country VARCHAR, zip INT)
CREATE TABLE offering_instructor (offering_instructor_id INT, offering_id INT, instructor_id INT)
| I need to fulfill a PreMajor requirement , what class would be the easiest ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 WHERE PROGRAM_COURSEalias1.category LIKE '%PreMajor%') | WITH "_u_0" AS (SELECT MIN("PROGRAM_COURSEalias1"."workload") FROM "program_course" AS "PROGRAM_COURSEalias1" WHERE "PROGRAM_COURSEalias1"."category" LIKE '%PreMajor%') SELECT DISTINCT "course"."department", "course"."name", "course"."number", "program_course"."workload", "program_course"."workload" FROM "course" JOIN "program_course" ON "course"."course_id" = "program_course"."course_id" AND "program_course"."category" LIKE '%PreMajor%' JOIN "_u_0" AS "_u_0" ON "_u_0"."" = "program_course"."workload" | 0.494141 |
CREATE TABLE table_203_633 (id DECIMAL, "title" TEXT, "year" DECIMAL, "platform" TEXT, "developer" TEXT, "publisher" TEXT)
| how many swat games were there before 2006 ? | SELECT COUNT("title") FROM table_203_633 WHERE "year" < 2006 | SELECT COUNT("title") FROM "table_203_633" WHERE "year" < 2006 | 0.060547 |
CREATE TABLE exhibition (Exhibition_ID INT, Year INT, Theme TEXT, Artist_ID INT, Ticket_Price FLOAT)
CREATE TABLE exhibition_record (Exhibition_ID INT, Date TEXT, Attendance INT)
CREATE TABLE artist (Artist_ID INT, Name TEXT, Country TEXT, Year_Join INT, Age INT)
| how many exhibitions has each artist had?, and could you order Y in ascending order? | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY COUNT(*) | SELECT "Name", COUNT(*) FROM "exhibition" AS "T1" JOIN "artist" AS "T2" ON "T1"."Artist_ID" = "T2"."Artist_ID" GROUP BY "T1"."Artist_ID" ORDER BY COUNT(*) NULLS FIRST | 0.162109 |
CREATE TABLE table_name_31 (opponent VARCHAR, date VARCHAR)
| Who were the Opponents on December 18, 2005? | SELECT opponent FROM table_name_31 WHERE date = "december 18, 2005" | SELECT "opponent" FROM "table_name_31" WHERE "date" = "december 18, 2005" | 0.071289 |
CREATE TABLE table_4487 ("Region" TEXT, "Operator" TEXT, "Licence award date" TEXT, "On air date" TEXT, "Closure date" TEXT)
| What was the operator of the ensemble from Yorkshire? | SELECT "Operator" FROM table_4487 WHERE "Region" = 'yorkshire' | SELECT "Operator" FROM "table_4487" WHERE "Region" = 'yorkshire' | 0.0625 |
CREATE TABLE table_name_43 (word__number INT, subframe__number INT)
| What is the total word count with a subframe count greater than 3? | SELECT SUM(word__number) FROM table_name_43 WHERE subframe__number > 3 | SELECT SUM("word__number") FROM "table_name_43" WHERE "subframe__number" > 3 | 0.074219 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.