• (cs)

    picks chin up off the floor

    OMFG

  • (cs) in reply to Steve

    Though of course, most tables in the example are truly bad, I don't necessarily think there is something wrong with having a unique id for every table.

  • (cs)

    Using this piece of crap as an excuse to mock those of us who believe in unique abstract id fields is a cheap shot.

    So in return I will treat you to a pot-pourri of traditional WTF responses, sans typos.

    My eyes! The goggles! They do nothing!

    They should have used JavaScript.

    The real WTF here is that they use pseudo Hungarian notation to name their tables.

    I realize this is tangentially relevant but back when I was in college I had to write an operating system in FORTRAN to run on C64s.

    The real WTF here is that they didn't CamelCase every word ("of" isn't capitalized).

    Sincerely,

      Gene Nixonko

    I realize this is tangentially relevant but did you realize that Oracle has TWO varchar types? No wonder Larry Ellison owns a 454-ft yacht.

    I bet this person was paid by the table row.

    This looks like the work of a highly-paid consultant (tm).

    I shudder to think of the VB front-end to this. Can you believe VB conditional evaluation doesn't short circuit until VB.NET?

    MY EYES THE GOGGLES THEY DO NOTHING

    FIRST!

    [pi]

    We all know the value of Yes is 42.

     

  • (cs) in reply to rogthefrog

    How could I forget!

    [insert horrid mangled html]

    Screw this forum software.

    Why does the captcha always fail on the first try?

    The real WTF here is this forum software.

    Sincerely,

      John Huckleberries

     

  • zompist (unregistered)

    That certainly will make it easy to add 'File Not Found' to tBoolean.

  • (cs) in reply to Steve

    That one is way past "WTF", it's an "Oh My Fucking God What Did I Do To You To Have This Thing Put In Front Of Me"...

    Being able to THINK a DB that way is an amazing, nearly unreal, feat. By itself.

  • (cs) in reply to rogthefrog

    You know you've been reading TDWTF for awhile when you laugh out loud at "Gene Nixonko"  :)

  • Adam (unregistered)

    Foul! This WTF isn't really about the supposed evils of artificial keys; it's about retarded lookup tables and stunningly inappropriate field data types.

  • (cs) in reply to Razzie
    Razzie:
    Though of course, most tables in the example are truly bad, I don't necessarily think there is something wrong with having a unique id for every table.


    The only time I'll allow a table without a unique ID is when I'm making a pure lookup table, where the only thing in it is junk that'll be selected into drop boxes and crap like that, where the data will never ever change...Like a list of state abbreviations, or something.

    Unique ID's, even if the data is just temp data, allow you to go the the exact data point that caused problems in a core dump, or allow you to update some seldom updated fields without a torturous WHERE clause. And they don't take much space, so whats the problem?

    I don't know why anyone would bother with this crap though. I only work with timestamps, not numerical dates, so the only issue is making sure it outputs the date in the correct format. A simple conditional will take care of that, and apparently save me from having to put together a half dozen tables fulla crap.


  • (cs) in reply to rogthefrog
    rogthefrog:

    Using this piece of crap as an excuse to mock those of us who believe in unique abstract id fields is a cheap shot.


    Sincerely,

      Gene Nixonko



    I agree.  The person is trying to mimic date fields rather then using built-in ones.  It's not a matter of id fields being unnecessary, it's a matter of the tables themselves being unnecessary.  But where the first part might be worthy of a weak WTF, the addition of the id field is hilarious.

    BTW, other than Geneko always signing his posts like that is there an old joke where someone wrote "Nixonko"?
  • (cs)

    OK, here come some half-assed justifications for you to slam [:)]

    tDayOfMonth: Semi-useful because one field gives you the leading zeroes and one doesn't.  OK, yes I know that sort of thing should be done on the presentation layer.  But having DayOfMonthID as IDENTITY instead of INT is a bit nutty, I will admit.

    tYearNumber: No excuse for this, sorry.

    tDecisionType: DecisionTypeID should be 0 and 1 to match real boolean values, but having Name and Dscp fields can be handy.  For example, Dscp can be used for tool tip text, assuming that it's not exactly the same as Name like it is here.

    tBoolean: I'll admit that I've done this.  If you have a boolean field that you want to present as a dropdown*, you can use this table to populate the text and value.  And, if someone in their infinite wisdom decides they want all dropdowns to say True or False instead, you only need to change it in one place.  Admittedly, there will ever only be two values here so using a table is a bit overkill -- unless you add "2 - Maybe" [:P]

    *I'm sure someone will argue that boolean fields should always be a chackbox.  But what if the boolean field is nullable and you want "Yes", "No", and " " as dropdown values?

     

  • (cs) in reply to rogthefrog
    rogthefrog:

    Using this piece of crap as an excuse to mock those of us who believe in unique abstract id fields is a cheap shot.

    So in return I will treat you to a pot-pourri of traditional WTF responses, sans typos.

    My eyes! The goggles! They do nothing!

    etc...

     


    rogthefrog, your table of varchar values is missing an identity column.

    I really enjoy seeing the use of varchar 50 to hold a 3 letter value.  (yes, I know that it would not cause trouble here because the tables are *probably* of a fixed rowcount...)

  • Brad (unregistered) in reply to Razzie
    Though of course, most tables in the example are truly bad, I don't necessarily think there is something wrong with having a unique id for every table.

    Counterexample: Join tables. When all you need to do is relate ID's from two other tables (where the ID's are used correctly, naturally), you can put a uniqueness constraint on the two columns and there's no need for a third identifier, since your queries will likely be things like, "get me all relations for record N" and "are records M and N related?"

  • (cs) in reply to rogthefrog
    rogthefrog:

    How could I forget!

    [insert horrid mangled html]

    Screw this forum software.

    Why does the captcha always fail on the first try?

    The real WTF here is this forum software.

    Sincerely,

      John Huckleberries

     


    rogthefrog you used all the usual comments, so this thread will be rather short. I must say it was  brillant.
  • (cs)

    The tYearNumber will certainly avoid Y2K and Y10K problems, with support for YearNumber up to the year (1 * 10^50) - 1:

    or, the year 99,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999,999

  • (cs)

    Damn.  How the hell are we going to get to a curly brace style" or "My programming language vs. yours" flamewar from here?

  • ZeoS (unregistered)

    <font size="6">O  M  G</font>

  • Rask (unregistered)

    Wow talk about a straw man, this is not what ID table argument pushes and you know it.  The WTF here has nothing to do with the ID columns, but the completely unecessary table themselves.

  • (cs)

    It's missing the tInt table. 

    IntID              IntValue                  IntDesc
    (INTEGER)   (VARCHAR(50))   (VARCHAR(150))
    1                     1                            One
    2                     2                            Two
    3                     3                            Three
    ...
    2147483647  2147483647           Two billion one hundred forty-seven million four hundred eighty-three thousand six hundred forty-seven

    I hate half-assed developers.

  • (cs) in reply to RevMike
    RevMike:
    Damn.  How the hell are we going to get to a curly brace style" or "My programming language vs. yours" flamewar from here?
  • (cs) in reply to Satanicpuppy
    I don't know why anyone would bother with this crap though. I only work with timestamps, not numerical dates, so the only issue is making sure it outputs the date in the correct format. A simple conditional will take care of that, and apparently save me from having to put together a half dozen tables fulla crap.

    What are the odds that the database you are using stores those unique dates as longs? Even using a timestamp as your unique is not guaranteed to be unique. Personally I like to use either a GUID (also not guaranteed to be unique) or an incremental column. Both timestamps and GUIDs suffer from debugging issues since they are a pain to manually link up when reviewing the data in the database. An incremental id column makes that a lot easier.

  • (cs) in reply to RevMike

    RevMike:
    Damn.  How the hell are we going to get to a curly brace style" or "My programming language vs. yours" flamewar from here?

    First, I'll try to use Firefox to quote you and reply. When that doesn't work correctly, I will dis the forum software for being written in .NET.

    Then, I will revile your use of quotes as being clearly incorrect, stupid. (Kay, your turn.)

  • (cs) in reply to WTFer

    First of all, I would like to second the straw man accusation.

    WTFer:
    rogthefrog:

    How could I forget!

    [insert horrid mangled html]

    Screw this forum software.

    Why does the captcha always fail on the first try?

    The real WTF here is this forum software.

    Sincerely,

      John Huckleberries

     


    rogthefrog you used all the usual comments, so this thread will be rather short. I must say it was  brillant.


    As for this, I think you're wrong.  I predict this will be the longest thread ever on TDWTF.

    Besides, you all forgot
       
        IsTrue("original post" == "straw man")
  • Wang (unregistered) in reply to Sean

    The wtf here is clearly only related to the use of identities.

     

    Each of those table defs is extremely useful (or would be with the correct datatyping).

    The 'boolean' is vital (perhaps not a great name) but really, you have to know the value of your bits.  It is sometimes suprising how many people think 1 is true when clearly it is 0.

    Tables of dates and at least as important tables of numbers are extremely useful - but only if you know what you are doing I suppose.

  • (cs) in reply to WTFer
    WTFer:
    rogthefrog:

    How could I forget!

    [insert horrid mangled html]

    Screw this forum software.

    Why does the captcha always fail on the first try?

    The real WTF here is this forum software.

    Sincerely,

      John Huckleberries

     


    rogthefrog you used all the usual comments, so this thread will be rather short. I must say it was  brillant.

    Brillant it is, but he forgot one thing - he didn't implement the isTrue() function for this thread.

  • (cs) in reply to quamaretto
    quamaretto:

    First, I'll try to use Firefox to quote you and reply. When that doesn't work correctly, I will dis the forum software for being written in .NET.

    Then, I will revile your use of quotes as being clearly incorrect, stupid. (Kay, your turn.)



    I use Firefox to quote and reply and have no problems... (although once I say this I know it'll barf).
  • Dave (unregistered) in reply to frosty

    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

  • (cs)

    Maybe the SQL engine in question didn't have CASE or stringification operators... in which case the tDayOfMonth table could come in handy.  It even zero-pads everything correctly.

  • (cs) in reply to frosty
    frosty:
    quamaretto:

    First, I'll try to use Firefox to quote you and reply. When that doesn't work correctly, I will dis the forum software for being written in .NET.

    Then, I will revile your use of quotes as being clearly incorrect, stupid. (Kay, your turn.)



    I use Firefox to quote and reply and have no problems... (although once I say this I know it'll barf).

    Yeah, I'm not sure what the problem was. But I'm not gonna try it again.

  • (cs) in reply to Dave

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.

  • (cs)

    Let me guess, every table in this database that stores a date value probably does so via including the following:

    DayofMonthID
    MonthofYearID
    YearID

    I'm horrified to think that there might also be tables like:

    tSecondofMinute
    tMinuteofHour
    tHourofDay

  • (cs) in reply to Maurits

    string result = "";
    for (int i = 0; isTrue(i < 3); i++) {
      result += i == 0 ? "Whiskey. " :  i==1 ? "Tango. " : i ==2 ? "Foxtrot." : "File Not Found";
    }
    return result;

  • Oscar Leeper (unregistered)

    There are those pedants who proclaim absolutely that either all tables must have primary keys or the negation thereof, and then there are those who actually know how to design a relational database... :P

  • (cs) in reply to Manni
    Manni:

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.



    Actually, Richard just started doing it to mock Gene Wirchenko.

    But yeah, back to the topic, identity fields suck.  Just look at the example of how every artificial key advocate uses them!!!!
  • (cs) in reply to Manni
    Manni:

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.



    Somewhere along the way I remembered about the Gene Whatchamacallhim, but if that's all the significance of "Nixonko", then case closed.
  • (cs)

    They are missing a row on tBoolean.  They need:
    2 FileNotFound

    .jc

  • (cs) in reply to IceBox13
    IceBox13:
    WTFer:
    rogthefrog:

    How could I forget!

    [insert horrid mangled html]

    Screw this forum software.

    Why does the captcha always fail on the first try?

    The real WTF here is this forum software.

    Sincerely,

      John Huckleberries

     


    rogthefrog you used all the usual comments, so this thread will be rather short. I must say it was  brillant.

    Brillant it is, but he forgot one thing - he didn't implement the isTrue() function for this thread.

    How could you call yourselves developers??
    The need to store the year, month AND day of month is for OPTIMIZATION!

  • (cs) in reply to Ytram
    Ytram:
    Manni:

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.



    Actually, Richard just started doing it to mock Gene Wirchenko.

    Well ya know what I heard? That Gene's little sister started going out with Brian from the football team, and he was totally two-timing her with Richard Nixon's wife, unbeknownst to him, which led to this huge confrontation between Richard and Gene and yadda yadda yadda, now we have a sales tax on cigarettes.

  • (cs) in reply to Sean
    Sean:
    It's missing the tInt table. 

    IntID              IntValue                  IntDesc
    (INTEGER)   (VARCHAR(50))   (VARCHAR(150))
    1                     1                            One
    2                     2                            Two
    3                     3                            Three
    ...
    2147483647  2147483647           Two billion one hundred forty-seven million four hundred eighty-three thousand six hundred forty-seven

    I hate half-assed developers.


    don't forget the Char table tChar
    CharID   Char Value   Char Desc
    a               a                     a
    b               b                     b
    .                .                       .
    .                .                       .
                                          blank

    we need specify the blank char!
  • (cs) in reply to Manni
    Mannilicious:
    Well ya know what I heard? That Gene's little sister started going out with Brian from the football team, and he was totally two-timing her with Richard Nixon's wife, unbeknownst to him, which led to this huge confrontation between Richard and Gene and yadda yadda yadda, now we have a sales tax on cigarettes.


    Gosh damn it!  That's why I'm paying more and more for cigarettes?

    I hear Gene's little sister is hot though.  However, Richard's wife is an unfortunate looking woman.
  • (cs) in reply to Ytram
    Ytram:
    Manni:

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.



    Actually, Richard just started doing it to mock Gene Wirchenko.

    But yeah, back to the topic, identity fields suck.  Just look at the example of how every artificial key advocate uses them!!!!


    I think you mean, "I suspect Richard just started doing it to mock Gene Wirchenko.".


    Sincerely,

    Richard Gene Nixon-Wirchenko
  • (cs)
    Alex Papadimoulis:

    tYearNumber:

    tYearNumber
    YearID
    (IDENTITY)
    YearNumber
    (VARCHAR(50))
    1 1900
    2 1901
    3 1902
    ...
    159 2058
    160 2059
    161 2060



    I very much doubt that this is what the idiot had in mind, but a table of fiscal years actually makes sense.  Even VARCHAR is occasionally useful when a business decides to change from one scheme to another, e.g.

    FY2005 = 7/1/04 - 6/30/05, prior fiscal years similar

    FY2006 = 1/1/06 - 12/31/06, subsequent fiscal years similar

    You can extend FY2005, but that throws off a lot of year-to-year and period-to-period comparisons.  Alternatively, you can define FY2005B = 7/1/05 - 12/31/05.

  • Rask (unregistered) in reply to Wang
    Anonymous:

    The wtf here is clearly only related to the use of identities.

     

    Each of those table defs is extremely useful (or would be with the correct datatyping).

    The 'boolean' is vital (perhaps not a great name) but really, you have to know the value of your bits.  It is sometimes suprising how many people think 1 is true when clearly it is 0.

    Tables of dates and at least as important tables of numbers are extremely useful - but only if you know what you are doing I suppose.



    I really hope that this is a joke, and that my sarcasm meter was off taking this seriously...
  • Gilgamesh (unregistered) in reply to limelight

    Nah, they'll create a tDate table containing DayofMonthID, MonthofYearID, YearID and of course, DateID since all tables must have a unique identifier.

  • (cs) in reply to rogthefrog

    rogthefrog:
    Using this piece of crap as an excuse to mock those of us who believe in unique abstract id fields is a cheap shot.

    Each day I use a piece of crappy work to mock those who believe in some crappy and incorrect software development practice. Today is no different.

    I strongly encourage those who might agree with such a design to take the time to learn before doing. Relational databases are in a fundamentally different world than procedural programming; trying to apply such principles through self-teaching is a recipe for disaster.

  • paula (unregistered) in reply to Dave
    Anonymous:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....


    Why has it taken me more 1 minute to realize how Freudian inventing Mayonnaise is?
  • (cs) in reply to Anonymoose
    Anonymoose:
    Ytram:
    Manni:

    Dave:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....

    You've been paying attention, but you have much to learn grasshopper. Both Richard Nixon and Gene Wirchenko sign their posts with "Sincerely". I'm starting to wonder if it's just the same guy with a split personality. Like Tyler Durden and... the uh.. other guy.



    Actually, Richard just started doing it to mock Gene Wirchenko.

    But yeah, back to the topic, identity fields suck.  Just look at the example of how every artificial key advocate uses them!!!!


    I think you mean, "I suspect Richard just started doing it to mock Gene Wirchenko.".


    Sincerely,

    Richard Gene Nixon-Wirchenko


    Nah, I'm pretty sure:

    http://www.thedailywtf.com/forums/47011/ShowPost.aspx#47024
  • Rask (unregistered) in reply to Alex Papadimoulis
    Alex Papadimoulis:

    Each day I use a piece of crappy work to mock those who believe in some crappy and incorrect software development practice. Today is no different.

    I strongly encourage those who might agree with such a design to take the time to learn before doing. Relational databases are in a fundamentally different world than procedural programming; trying to apply such principles through self-teaching is a recipe for disaster.



    Two more straw man arguments in the same post.
  • (cs) in reply to Wang
    Anonymous:

    The 'boolean' is vital (perhaps not a great name) but really, you have to know the value of your bits.



    My bits are quite valuable to me, but that doesn't mean it's a "yes or no" thing. I mean, if someone was going to take my life or my bits, I would have to make a judgement there; and if all I've got is "true" meaning "Yes, I value my bits," then I've got no context for making the decision between life and bits. Furthermore, I could never instruct a computer to make the same choice for me, other than to make random choice between everything that has a value of 'true'.

    That's why every table should have a unique 'SortOrder' column.
  • (cs) in reply to paula
    paula:
    Anonymous:
    The Nixonko reference it to the dude that signs his posts as Richard Nixon, the inventor of Mayonnaise (I think)....


    Why has it taken me more 1 minute to realize how Freudian inventing Mayonnaise is?


    How Freudian is it?

    BTW, are you Paula of PaulaBean fame?

Leave a comment on “A Truly ID-iotic Design”

Log In or post as a guest

Replying to comment #:

« Return to Article