• (cs)

    The "Select One" row isn't that odd. You just check for a state code of "none" when you process the form, and don't have to do any more work. Also, easy localization: SELECT FROM states WHERE shortName != 'none' OR state_id == 51 + LanguageIndex;

  • @Deprecated (unregistered) in reply to duder
    Aaron:
    I'll be the "i wonder if jan..." column name was the result of someone not noticing that their IM client no longer had focus.

    Bill: John's contract finished up lat month. Fred: Yes, I sent the billing request to jan last week. Bill: ID Fred: uhhh ?

  • Sarah (unregistered) in reply to hoodaticus
    hoodaticus:
    Leo:
    According to Barack Obama, you're still missing 6 states.

    Not so! Obama said he'd been to 57 states, with one to go!

    This, from a sitting Senator.

    With one to go, and not including Hawaii and Alaska..... Oh wait, he obviously meant 47

  • Organizer (unregistered) in reply to jordanwb

    Also, legal requirements expire. US Federal tax audits go back seven years, and businesses can delete older records.

  • silverpie (unregistered) in reply to Sarah
    Sarah:
    hoodaticus:
    Leo:
    According to Barack Obama, you're still missing 6 states.

    Not so! Obama said he'd been to 57 states, with one to go!

    This, from a sitting Senator.

    With one to go, and not including Hawaii and Alaska..... Oh wait, he obviously meant 47

    I think the states he has been to do include Hawaii--he went to high school there...

  • nerdy girl (unregistered) in reply to Blue Collar
    Blue Collar:
    Zapp Brannigan:
    Anonymous:
    I had a great comment but the moment has passed now. Then I had a somewhat crappier comment about how I originally had a great comment. That got deleted. Now I'm feeling really insecure and more than anything I just want to get involved in this discussion but you're just going to keep on deleting my posts until finally I have to KILL MYSELF. Is that seriously what you people want? I just want to be accepted, don't allow me to die alone...
    In the end, we all die alone.

    Unless you die in a plane crash... then you'll have company.

    Unless you die because the plane's engine falls on your bed while you sleep...then you'll have to run around doing crazy shit to make sure you are in your bed at the time so you can actually die because if you don't, the universes start to branch and multiply. I think.

  • (cs)

    Sometimes, when interfacing between two systems, you need to come up with workarounds just to get data from one system to another. I have one system that when you export data from it, instead of allowing a null value it actually sends #NULL. I had to do something very similar to that forth one. It looks dumb but it prevents throwing errors.

  • Zapp Brannigan (unregistered) in reply to nerdy girl
    nerdy girl:
    Blue Collar:
    Zapp Brannigan:
    Anonymous:
    I had a great comment but the moment has passed now. Then I had a somewhat crappier comment about how I originally had a great comment. That got deleted. Now I'm feeling really insecure and more than anything I just want to get involved in this discussion but you're just going to keep on deleting my posts until finally I have to KILL MYSELF. Is that seriously what you people want? I just want to be accepted, don't allow me to die alone...
    In the end, we all die alone.

    Unless you die in a plane crash... then you'll have company.

    Unless you die because the plane's engine falls on your bed while you sleep...then you'll have to run around doing crazy shit to make sure you are in your bed at the time so you can actually die because if you don't, the universes start to branch and multiply. I think.

    Someone's been talking to the rabbit again.

  • (cs)

    God help us come 2013, indeed. If Hollywood and New Age lunatics have taught us anything, anything at all, it's that we are all screwed December 23, 2012. Hence, the lack of any year afterwards.

  • (cs) in reply to Leo
    Leo:
    According to Barack Obama, you're still missing 6 states.
    QFT!
  • (cs)

    I've got a client whose table of states (tblStates, of course) contains rows for all 50 states plus DC and Puerto Rico. The ID on the table isn't sequential by any known rhyme or reason, and skips some numbers (Hawaii, Alaska and Puerto Rico are numbers 52, 54 and 58, respectively). So they've got another column, which is "display order". These are mostly in a sane order, except that the order value for Texas is null...

  • (cs)

    My table of states only has 10 entries, and that's including one for Head Office and one for Unspecified. (This is the data warehouse, so we need that one for everything that we can't pin a real state to.) Obviously this is a far more efficient implementation.

    Admittedly this could also have something to do with being in Australia. :)

  • Milligan (unregistered) in reply to GalacticCowboy
    GalacticCowboy:
    ... the order value for Texas is null...

    Wow, they seceded already?

  • (cs) in reply to bored
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.

    Seems sensible to be. It makes the form code a lot simpler, and if client side validation (say, javascript) is bypassed, the database isn't going to end up with an invalid foreign key somewhere. (Of course, server-side validation should prevent that anyway.)

    It's also possible it's doing double-duty as the value used for people outside the US. (The javascript form asks for country first, and only shows State if they choose USA as their country). That would be kludgy though.

  • Territorial (unregistered) in reply to Scarlet Manuka
    Scarlet Manuka:
    My table of states only has 10 entries, and that's including one for Head Office and one for Unspecified. (This is the data warehouse, so we need that one for everything that we can't pin a real state to.) Obviously this is a far more efficient implementation.

    Admittedly this could also have something to do with being in Australia. :)

    Clearly your table should only be 8 entries long(including head office and "unspecified").

  • Chewbacca (unregistered) in reply to Xenon Xavior
    Xenon Xavior:
    I believe that row 51 is akin to area 51. The poster of this image and all who have seen it will be systematically eliminated by the govern... *dies suddenly*

    Haha, that reminds me of the old Candlejack meme. Supposedly, after saying/typing his name you sudd

  • Chewbacca (unregistered) in reply to JV
    It seems kinda silly to copy that array[n] to a new array[n+1] element-by-element just so that the first element can be "Select One".
    Yeah, gods forbid you hardcode "Select One". It might change on a daily basis!

    ...now why is my CAPTCHA "eros"? Are you coming on to me?

  • Loveknuckle (unregistered) in reply to m0ffx
    m0ffx:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.

    Seems sensible to be. It makes the form code a lot simpler, and if client side validation (say, javascript) is bypassed, the database isn't going to end up with an invalid foreign key somewhere. (Of course, server-side validation should prevent that anyway.)

    It's also possible it's doing double-duty as the value used for people outside the US. (The javascript form asks for country first, and only shows State if they choose USA as their country). That would be kludgy though.

    God I hate fixing code written by people like you.

  • Casey (unregistered)

    The 51 state rows sounds clever. It can be used to display "Choose One" in the state field until you do.

    The real WTF is that there is no D.C., as I've never seen a state drop down box without it.

  • Rodnas (unregistered)

    Alex WTF?

    The Daily WTF was down yesterday. I needz my daily dosage of WTF or i get all depressed. snif I feel a lot better now. Thanks.

    Sandor

  • Jasper (unregistered)

    Ofcourse there is no 2013 and further in the table! Everybody knows the world ends in 2012!

  • moz (unregistered) in reply to Leo
    Leo:
    According to Barack Obama, you're still missing 6 states.
    Was anyone else disappointed by the "view all 21,178 comments" (or whatever number it is now) button on the youtube page? Why not call it "view 500 latest comments" in the first place?
  • Kef Schecter (unregistered)
    Kef Schecter:
    Editors Note: Just so you know, Kef, you don't at all come across as "some extreme Obama (or Democrat) fanboy". Because this was a perfectly rational response to a mildly amusing reference to an old campaign video.

    Yeah, it was a little silly, I guess. Everybody has their berserk button, though. shrug

    (I tried linking "berserk button" to TVTropes, but Akismet said no. So... just imagine there's a hyperlink there, I guess.)

    • Kef
  • (cs) in reply to Outtascope
    Outtascope:
    Zapp Brannigan:
    Anonymous:
    I had a great comment but the moment has passed now. Then I had a somewhat crappier comment about how I originally had a great comment. That got deleted. Now I'm feeling really insecure and more than anything I just want to get involved in this discussion but you're just going to keep on deleting my posts until finally I have to KILL MYSELF. Is that seriously what you people want? I just want to be accepted, don't allow me to die alone...
    In the end, we all die alone.

    Not true my friend. Now personally, I just want to go quietly in my sleep like my Grandpa. Not like the four other people riding in the car with him.

    captcha appellatio: What Granny Smith does to Jonathan?

    I think the punch line works better if it's "Not screaming in terror like the passengers in his car."

    IMHO.

  • (cs) in reply to silverpie
    silverpie:
    Sarah:
    hoodaticus:
    Leo:
    According to Barack Obama, you're still missing 6 states.

    Not so! Obama said he'd been to 57 states, with one to go!

    This, from a sitting Senator.

    With one to go, and not including Hawaii and Alaska..... Oh wait, he obviously meant 47

    I think the states he has been to do include Hawaii--he went to high school there...

    He was referring to the states he had been to on that particular campaign trip, not all the states he had ever been to in his entire life.

  • Uncle Buck (unregistered)

    I don't think we'll need to worry about 2013... everyone knows the earth will end in 2012

  • right? (unregistered) in reply to Uncle Buck
    Uncle Buck:
    I don't think we'll need to worry about 2013... everyone knows the earth will end in 2012

    ROFL! What an original joke!

  • bored (unregistered) in reply to Scott Simmons

    I understand the reasoning but it is not correct. The default item in a drop down in this case is not a State. They can accomplish the same thing with something as simple as a union on their select from on the database. Or even on the front end in their code they can insert it.

  • Jim (unregistered) in reply to right?

    It's a optimization in fact :)

  • (cs) in reply to bored
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".
  • (cs) in reply to Someone You Know
    Someone You Know:
    silverpie:
    Sarah:
    hoodaticus:
    Leo:
    According to Barack Obama, you're still missing 6 states.

    Not so! Obama said he'd been to 57 states, with one to go!

    This, from a sitting Senator.

    With one to go, and not including Hawaii and Alaska..... Oh wait, he obviously meant 47

    I think the states he has been to do include Hawaii--he went to high school there...

    He was referring to the states he had been to on that particular campaign trip, not all the states he had ever been to in his entire life.

    If we're counting all the ones he has ever been to in his entire life, it must be OVER 9000!
  • (cs) in reply to Zapp Brannigan
    Zapp Brannigan:
    nerdy girl:
    Blue Collar:
    Zapp Brannigan:
    Anonymous:
    I had a great comment but the moment has passed now. Then I had a somewhat crappier comment about how I originally had a great comment. That got deleted. Now I'm feeling really insecure and more than anything I just want to get involved in this discussion but you're just going to keep on deleting my posts until finally I have to KILL MYSELF. Is that seriously what you people want? I just want to be accepted, don't allow me to die alone...
    In the end, we all die alone.

    Unless you die in a plane crash... then you'll have company.

    Unless you die because the plane's engine falls on your bed while you sleep...then you'll have to run around doing crazy shit to make sure you are in your bed at the time so you can actually die because if you don't, the universes start to branch and multiply. I think.

    Someone's been talking to the rabbit again.

    Remember What the dormouse said.
  • (cs) in reply to ContraCorners
    ContraCorners:
    (Lucky me... comment #51)
    Commentstrip One?
  • (cs) in reply to DaveK
    DaveK:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".

    To which I would only add, "unneccessarily".

  • (cs) in reply to right?
    right?:
    Uncle Buck:
    I don't think we'll need to worry about 2013... everyone knows the earth will end in 2012

    ROFL! What an original joke!

    I am so looking forward to 2012 coming and going without event. If you thought taking the piss out of the millennium-bug-survivalists was fun in 2001, just wait until 2013, when we get to mock the collective lackwittery of the participants in Nostradamus fandom, New Age pseudo-mystic-IncaAztecMayan revivalism, and neo-gullibilist singularity beliefs, all at the same time! Never before in the course of human mockery will so much wit have been lacked by so many to such little effect!
  • (cs) in reply to hoodaticus
    hoodaticus:
    DaveK:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".

    To which I would only add, "unneccessarily".

    Indeed. For the convenience and enlightenment of others, here follows a full list of the circumstances under which it actually is a good idea to entangle the business layer with the presentation layer:
  • J (unregistered) in reply to Jackson Curtis
    Jackson Curtis:
    I'm pretty sure the designer of the year table was smart enough to know there was no need to support 2013.

    I'm pretty sure there's no "designer of the year" for databases award.

  • luptatum (unregistered) in reply to MOH
    MOH:
    Someone:
    SenderRecordEmployeeNameWhoPerformedTheLastChangeInGunship "Gunship"? is that really that sensitive? At least, that what the crossed-out part looks like to me.

    Nonsense. It clearly says bunslip.

    More like bunslop or bunslap.

    What the hell kind of a company is that anyway?

  • luptatum (unregistered) in reply to Scarlet Manuka
    Scarlet Manuka:
    My table of states only has 10 entries, and that's including one for Head Office and one for Unspecified. (This is the data warehouse, so we need that one for everything that we can't pin a real state to.) Obviously this is a far more efficient implementation.

    Admittedly this could also have something to do with being in Australia. :)

    Order Processed/Sent/Billed/Texas

    Wait.. what?

  • tego? what's that? counterfeit lego? (unregistered) in reply to moz
    moz:
    Leo:
    According to Barack Obama, you're still missing 6 states.
    Was anyone else disappointed by the "view all 21,178 comments" (or whatever number it is now) button on the youtube page? Why not call it "view 500 latest comments" in the first place?
    QFT. Fuckers.
  • Anon (unregistered) in reply to peet

    Year tables can also be necessary for querying things like events per year when you need all years even if there are no events. Outer join FTW!

  • mypalmike (unregistered)

    As a resident of Select One, I'm amazed at how ignorant my fellow Americans are of geography. Select One may be the smallest state, but we've got big hearts, and we pay taxes just like you fancy North Dakotans.

    Sincerely, mypalmike Springfield, SO

  • (cs) in reply to DaveK
    DaveK:
    hoodaticus:
    DaveK:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".

    To which I would only add, "unneccessarily".

    Indeed. For the convenience and enlightenment of others, here follows a full list of the circumstances under which it actually is a good idea to entangle the business layer with the presentation layer:

    Client-side validation anyone?

  • (cs) in reply to hoodaticus
    hoodaticus:
    DaveK:
    hoodaticus:
    DaveK:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".

    To which I would only add, "unneccessarily".

    Indeed. For the convenience and enlightenment of others, here follows a full list of the circumstances under which it actually is a good idea to entangle the business layer with the presentation layer:

    Client-side validation anyone?

    Not "entangled" if done properly; improperly done if entangled. IMO of course; there are always "reasons" for doing things kludgily, but they're generally not /good/ reasons but forced compromises.
  • (cs) in reply to DaveK
    DaveK:
    hoodaticus:
    DaveK:
    hoodaticus:
    DaveK:
    bored:
    I like how they put a Select One or Choose One or Please Select from Dropdown, actually IN the database.
    It's more-or-less the epitome of "confusing the business layer with the presentation layer".

    To which I would only add, "unneccessarily".

    Indeed. For the convenience and enlightenment of others, here follows a full list of the circumstances under which it actually is a good idea to entangle the business layer with the presentation layer:

    Client-side validation anyone?

    Not "entangled" if done properly; improperly done if entangled. IMO of course; there are always "reasons" for doing things kludgily, but they're generally not /good/ reasons but forced compromises.

    I was responding to the notion of "confusion" between business and presentation, which is what the maintainer of the code will experience when having to update business rules in both layers. If business rules are just in the business layer, the client-side validation will mean passing those rules up to the presentation layer somehow, which eliminates confusion but IMO entangles the two layers via the rules-containing machinery that passes from BL to PL.

    As long as we need to discriminate between numbers and letters, this is going to be an issue in a tiered architecture where one data-providing tier cannot be trusted.

    But this conversation is probably about the definitions of "confusion" and "entanglement" rather than what we agree on: in an ideal world, tiers have no coupling at all.

    Addendum (2009-12-17 17:41): Maybe client-side validation is the forced compromise; that I can definitely agree with.

  • jf (unregistered)

    `i wonder if jan ever sent him his check?' - my guess is this is what you get from those tools that let you 'edit' your database schema. The cause is most likely they hit F2 to rename the column (or maybe just a double click like a file manager, who knows how easy these tools make it these days) and Ctrl-V to paste and they had something crazy in their clipboard.

  • Scott Simmons (unregistered)

    m0ffx:

    Seems sensible to be. It makes the form code a lot simpler, and if client side validation (say, javascript) is bypassed, the database isn't going to end up with an invalid foreign key somewhere. (Of course, server-side validation should prevent that anyway.)
    bored:
    I understand the reasoning but it is not correct. The default item in a drop down in this case is not a State. They can accomplish the same thing with something as simple as a union on their select from on the database. Or even on the front end in their code they can insert it.
    bored is absolutely correct here. You can prevent having an invalid foreign key by correctly enforcing foreign keys in the DBMS. Except that if you do shit like this, you can't, because from the DBMS point of view, 'Select One' is a valid state name; and if the validation on the client-side fails somehow, you end up with database records with this listed as a state. This is not an theory I'm inventing--I have seen it happen, and it is virtually impossible to clean up the database afterwards. Not to mention embarrasing when a senior VP of marketing sees it on his reports. And frankly, it's not really that hard to code the application to display correctly. I mean, it's always harder to do something right than to do it half-ass, but this is really a matter of a few minutes of coding time--why not just set it up correctly in the first place? If you don't know enough to do this pretty easily, you probably don't know enough to make sure the front-end validation works right anyway.

    Loveknuckle:

    God I hate fixing code written by people like you.
    Plus, you'll piss off Loveknuckle. :-)

  • Juan (unregistered)

    the name of the column as the fist row??? ...I wonder if that's *

  • Software worker (unregistered)

    Whats the matter with an Asterisk as a Boolean Flag? There is a big three letter company out there where ' ' equals false and 'X' or 'x' equals true.

    Grown codebases are the best.

  • CB (unregistered)

    For the first 2 screen shots, what is the program being used to view the databases?

Leave a comment on “The Year Table, Row 51, and other Database Oddities”

Log In or post as a guest

Replying to comment #:

« Return to Article