please give me a solution for this request

  • capn.hector (4/23/2012)


    SQLKnowItAll (4/23/2012)


    Jeff Moden (4/23/2012)


    capn.hector (4/23/2012)


    +1 however i saw this same question as homework for one of my sql classes.

    Interesting! Where did you take such a class? I ask because it's not exactly a BOL or CERT question and it's nice to see such classes teaching a practical thing (in this case, the pre-cursor to how CROSS TABS work).

    It's a good thing as long as they teach that this data "should" never exist 🙂 We don't want people to learn that "there are script fixes for bad design, so who cares about the design." I only say this because I have worked with developers who think it is my job to return the data properly, but they can store it however they want.

    it was a question during our transform data to normalize a bad design segment of a database design course. it went about like this: there is this table with bad data like so (ID,col1,col2,col2) Values (1,stuff,null,null),(1,null,stuff,null),(1,null,null,stuff),(2,Stuff,null,null)... how can you fix the data to normalize the table and get rid of the bad design?

    Heh... Yeah, I knew it was going to be something like that. What I want to know is what the name of the database design course was, who offered it, and where?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (4/28/2012)


    capn.hector (4/23/2012)


    SQLKnowItAll (4/23/2012)


    Jeff Moden (4/23/2012)


    capn.hector (4/23/2012)


    +1 however i saw this same question as homework for one of my sql classes.

    Interesting! Where did you take such a class? I ask because it's not exactly a BOL or CERT question and it's nice to see such classes teaching a practical thing (in this case, the pre-cursor to how CROSS TABS work).

    It's a good thing as long as they teach that this data "should" never exist 🙂 We don't want people to learn that "there are script fixes for bad design, so who cares about the design." I only say this because I have worked with developers who think it is my job to return the data properly, but they can store it however they want.

    it was a question during our transform data to normalize a bad design segment of a database design course. it went about like this: there is this table with bad data like so (ID,col1,col2,col2) Values (1,stuff,null,null),(1,null,stuff,null),(1,null,null,stuff),(2,Stuff,null,null)... how can you fix the data to normalize the table and get rid of the bad design?

    Heh... Yeah, I knew it was going to be something like that. What I want to know is what the name of the database design course was, who offered it, and where?

    it took me a little while to find the example. it was on a hand out and not in the book. there was the bad entry per id and the bad design where only one of 3 columns could have an entry (and the other 2 would be null). Jeff ill pm you the design course.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply