Asides

SELECT Yourself

Today’s question is very simple.

If you were any type of T-SQL query, what type would you be?

Personally, I see myself as the type of query that looks normal enough, but causes all sorts of problems once you let it loose in production, but you don’t want to kill it because you are afraid to wait for the rollback.

Discussion

9 comments for “SELECT Yourself”

  1. This would be a better “stupid interview question” than the normal “stupid interview questions” (“what kind of vegetable or animal would you be? “)

    As for a SQL Query that I would be… I have a lot of interests that while different, have some common themes between them. There are some overarching principles I try to live by.

    So I would probably have a CTE of my common principals, values, etc. and then find the commonality between the interests and do a few unioned selects.

    Posted by Mike Walsh | April 17, 2009, 7:55 am
  2. Easy – Undocumented sql commands running inside a trigger that deletes uses x0BADCAFE as the first bit of its @sql_handle.

    Posted by David | April 17, 2009, 8:04 am
  3. SELECT D.Lname + ‘, ‘ + D.Fname
    FROM DBPros D
    INNER JOIN

    Posted by Tim Ford | April 17, 2009, 8:29 am
  4. Damn TABS!

    Posted by Tim Ford | April 17, 2009, 8:30 am
  5. I’m some sort of stored procedure that would calculate some statistical information to be used for some sort of detailed analysis report for someone. Sort of like baseball data. What is the batting average of left-handed hitters against left-handed pitchers after 9 p.m. when the humidity is <= 58% and the wind is < 9 m.p.h.

    sp_ReferenceLibrarian

    Posted by wnylibrarian | April 17, 2009, 8:32 am
  6. SELECT D.Lname + ‘, ‘ + D.Fname
    FROM DBPros D
    INNER JOIN People_Statuses PS ON D.dbp_id = PS.dbp_id
    INNER JOIN Statuses S ON PS.status_id = S.status_id
    INNER JOIN People_Personalities PP ON D.dbp_id = PP.dbp_id
    INNER JOIN Personalities P ON PP.pers_id = P.pers_id
    INNER JOIN People_Skillset PS ON D.dbp_id = PS.dbp_id
    INNER JOIN SkillSet SS ON PS.skillset_id = SS.skillset_id
    INNER JOIN People_ExtracurricularActivities PEA ON D.dbp_id = PEA.dbp_id
    INNER JOIN ExtracurricularActivities EA ON PEA.ea_id = EA.ea_id
    WHERE
    S.status_desc IN (‘chillaxed’, ‘stressed’) –Yes, can be both aka “tech bi-polarism”
    AND P.personality_desc = ‘confident’
    AND SS.skillset_desc IN (‘DBA_General’, ‘SSIS’, ‘Internals’, ‘DMV’, ‘Development’, ‘TSQL’, ‘VB’, ‘Agent’)
    AND EA.ea_desc IN (‘Skiing’, ‘Gaming’, ‘Reading’, ‘Photography’, ‘Volunteerism’, ‘Coffee Snobery’, ‘Zymurgy’, ‘Cooking’, ‘Technogeekery’, ‘Gardening’, ‘Parenting’, ‘Fitness’)

    Posted by Tim Ford | April 17, 2009, 9:00 am
  7. I’d be a SHRINK DATABASE.

    Posted by Jeremiah Peschka | April 18, 2009, 9:39 am
  8. well, that explains your fragmented state of mind

    Posted by SQLBatman | April 18, 2009, 10:55 am
  9. I’d be INSERT INTO dbo.YourMom.

    Posted by Brent Ozar | April 18, 2009, 7:51 pm

Post a comment