• pjt56 (unregistered) in reply to FragFrog

    No it doesn't: http://en.wikipedia.org/wiki/Begging_the_question

  • (cs) in reply to Kuba
    Kuba:
    John Doe:
    chubertdev:
    what the hell are you talking about? you think that no developers know anything about databases just because of the clueless SOB in the story?
    Look at StackOverflow. The majority of "n00bs" asking about SQL write horrible SQL
    Sorry to rain on your parade, Sherlock, but if they knew SQL well, they wouldn't ask, right?

    80/20 rule. 80% of developers can't program, 80% of DBAs aren't normal.

    see what I did there?

  • Norman Diamond (unregistered)
    snoofle:
    Since their time was short and the developers were leary of modifying the code that referenced this table, Doug gave them the following query (with comments):
    Did I read this right? The developers were leary but the DBA was the one on acid?
  • Bill C. (unregistered)
    snoofle:
    You can join with a person of your choosing. Joins can be good things. Sometimes...
    Right or wrong, that's how we did it back in the days when we did the choosing and the intern's opinion didn't matter.
  • Matt (unregistered) in reply to FragFrog

    [quote user="FragFrog"][quote user="PK"] Clearly, nobody there including the DBA's have the slightest clue about database normalization. Which begs the question: what exactly is it that the DBA's there do?[/quote]

    They take the specs from the customer, and they bring them to the engineers.....

  • anonymous (unregistered) in reply to Tasty
    Tasty:
    anonymous:
    Reminds me of the time I had to do the reverse: the table had a whole bunch of numbered columns, and only a few of them were usually used. The resulting report only printed 2 records per page because it was printing all of those empty fields.

    After (very briefly) considering re-engineering the database to put each row in a separate table and link the tables with a key (it would have required completely redesigning the data entry form, which had lots of text boxes), I rolled up my sleeves and typed this instead:

    SELECT tbl.id, tbl.Date, 1 AS row,
    tbl.costcode1 as costcode, tbl.faccode1 as faccode, tbl.code1 as code, tbl.hrs1 as hrs, tbl.min1 as min,
    tbl.wonum1 as wonum, tbl.comments1 as comments, tbl.shift1 as shift, emp.lname, emp.minit, emp.fname
    FROM emp INNER JOIN [tbl] ON emp.id = tbl.id
    WHERE tbl.Date = [Forms]![Main]![dtm]
    AND (costcode1 > "" OR comments1 > "")
    UNION ALL
    SELECT tbl.id, tbl.Date, 2 AS row,
    tbl.costcode2, tbl.faccode2, tbl.code2, tbl.hrs2, tbl.min2,
    tbl.wonum2, tbl.comments2, tbl.shift2, emp.lname, emp.minit, emp.fname
    FROM emp INNER JOIN [tbl] ON emp.id = tbl.id
    WHERE tbl.Date = [Forms]![Main]![dtm]
    AND (costcode2 > "" OR comments2 > "")
    UNION ALL
    SELECT tbl.id, tbl.Date, 3 AS row,
    tbl.costcode3, tbl.faccode3, tbl.code3, tbl.hrs3, tbl.min3,
    tbl.wonum3, tbl.comments3, tbl.shift3, emp.lname, emp.minit, emp.fname
    FROM emp INNER JOIN [tbl] ON emp.id = tbl.id
    WHERE tbl.Date = [Forms]![Main]![dtm]
    AND (costcode3 > "" OR comments3 > "")
    ...
    UNION ALL
    SELECT tbl.id, tbl.Date, 12 AS row,
    tbl.costcode12, tbl.faccode12, tbl.code12, tbl.hrs12, tbl.min12,
    tbl.wonum12, tbl.comments12, tbl.shift12, emp.lname, emp.minit, emp.fname
    FROM emp INNER JOIN [tbl] ON emp.id = tbl.id
    WHERE tbl.Date = [Forms]![Main]![dtm]
    AND (costcode12 > "" OR comments12 > "")
    ORDER BY fname, lname, row;

    It looks ugly and takes longer to run (12 times longer, to be exact), but the resulting report uses a lot less paper.

    You're probably eating memory or disk swapping! Drop the ORDER BY and I'll bet it runs much faster.

    I can't. The names need to be in alphabetical order, and the line items have to be in the same order as they were entered originally (which is the reason behind 1 AS row, 2 AS row, etc. and then ORDER BY ... row).

    It's not really that much data, anyway; it's mainly just slow because, well, Access.

  • Harrow (unregistered)

    I wish you would show a little more sensitivity. I have a son who is a DBA, and let me tell you it is no laughing matter.

  • I kill them (unregistered) in reply to Harrow
    Harrow:
    I wish you would show a little more sensitivity. I have a son who is a DBA, and let me tell you it is no laughing matter.

    I am sorry to learn about your retarded son...

  • Jay (unregistered) in reply to da Doctah
    da Doctah:
    Jay:
    Because if you have a choice between, say, buying a car that runs for $15,000 or a car that doesn't run for $10,000, obviously the second choice is the more efficient and economical one. Any discussion of how much it will cost to get it running, or if that is even possible, is irrelevant. It is a car, it is cheaper, therefore it is the better choice.

    This. I don't know how many times I've had some form of the following conversation:

    Boss: "Application XYZ doesn't work. How much will it cost to develop a replacement."

    Me: "Fifteen thousand."

    Boss: "But Application XYZ only cost twelve thousand! Can't you come down a little?"

    Me: "I thought you said Application XYZ doesn't work."

    Boss: "That's right."

    Me: "Oh, I misunderstood the requirements. I can develop something that doesn't work for ten thousand."

    +1 I'll be plagiarizing this in a future staff meeting.

  • (cs)

    TRWTF is using this title for an article that isn't about Google.

  • Neil (unregistered) in reply to Tasty
    Tasty:
    anonymous:
    It looks ugly and takes longer to run (12 times longer, to be exact), but the resulting report uses a lot less paper.
    You're probably eating memory or disk swapping! Drop the ORDER BY and I'll bet it runs much faster.
    I'll bet it takes you more than 12 times longer to cut up the pieces of paper and reassemble them in order.
  • Neil (unregistered) in reply to Tasty
    Tasty:
    ANON:
    But to be fair even the select Doug gave to them is ugly:
    select applications.name, attribute, listen_port, AD1.admin1, AD2.admin2 
          from applications
          left outer join (select name, MIN(admin) as admin1 
                             from application_admins 
                            group by name) as AD1 using name 
          left outer join (select name, MAX(admin) as admin2 
                             from application_admins 
                            group by name) as AD2 using name
    This would do the same:
    select applications.name, attribute, listen_port, AD.admin1, AD.admin2 
          from applications
          left outer join (select name, MIN(admin) as admin1, MAX(admin) as admin2               
                             from application_admins 
                            group by name) as AD using name

    Why is everyone accepting the left outer join or any outer join? Every column in application_admins is not null.

    That would be true if you were interested in the admins and happened to want to know the attribute and port of the application, but not if you were interested in the application and any admins it may or may not have. Anyway, here's another alternative, but you should of course profile it to find out whether it outperforms the previous suggestions:
    select applications.name, attribute, listen_port, MIN(admin) AS admin1, MAX(admin) AS admin2
    from applications
    left outer join application_admins using name
    group by applications.name, attribute, listen_port

  • justme (unregistered) in reply to clively
    clively:
    For the love of god stop letting developers *design* anything. They can't. We know this. Sure they can type in stuff called "code" which usually does a half ass job of making peoples lives better and a full ass job of making them want to rip the developer to pieces.

    Development managers are even worse. They will put together an "architecture" that has more to do with the tools they have a religious experience with than with anything resembling actual business requirements.

    I've seen too many applications put together by developers with little to no oversight. Usually a business requirement will come up, that was completely foreseeable but apparently wasn't something the dev even considered: like the example in the story. Then, rather than "fix" the problem the right way, they spend hours arguing how it is too hard to change or not "feasable" or what have you then proceed to make things worse.

    Are you sure we didn't just work on a project together ? I have a "rock-star" programmer who thinks he can architecture.

  • Axel (unregistered)

    "...developers were leary..."

    If you're gonna name-drop, capitalize the first letter.

    Alternatively, you could spell "leery" correctly.

Leave a comment on “Don't Be Evil”

Log In or post as a guest

Replying to comment #:

« Return to Article