Results 1 to 12 of 12
  1. #1
    Join Date
    Apr 2010
    Posts
    9

    Question Unanswered: please provide composite key from this select result

    1000874|EEER|4/13/2010|100|452.32|B|4/13/10 5:06 AM
    1000874|EEER|4/13/2010|100|452.32|B|4/13/10 5:07 AM
    1000874|EEER|4/15/2010|60|452.32|S|4/13/10 8:06 AM
    1000874|EEER|4/13/2010|100|452.32|B|4/13/10 5:08 AM
    1000874|EES|4/13/2010|80|125.4|B|4/13/10 5:06 AM
    1000874|EES|4/13/2010|450|126.8|B|4/13/10 5:06 AM
    |

    This is the result from table. Could you answer, what is composite key for this table? What columns you will choose from Composite key for this table?
    Last edited by y0zh; 04-22-10 at 12:38.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Think about it. Which are the fewest columns you would need to uniquely identify any record?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Apr 2010
    Posts
    9
    COUNTSS and DATEINSERT ?

    ID NAMELEVEL DATEBEGIN COUNTSS SALARY TRUEFALSE DATEINSERT

  4. #4
    Join Date
    Apr 2010
    Posts
    9
    Any answer?

  5. #5
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    I would think, this would be decided in a modeling session based on what the application needed. But from looking at the above names I would think it would be ID NAMELEVEL DATEINSERT
    Dave

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by y0zh View Post
    Any answer?
    Uhm....not since you edited the post and removed column headers. No.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Apr 2010
    Posts
    9
    Quote Originally Posted by dav1mo View Post
    I would think, this would be decided in a modeling session based on what the application needed. But from looking at the above names I would think it would be ID NAMELEVEL DATEINSERT
    Dave
    Could you recommed composite key for this table?
    Any usefull idea whould be usefull for me. Thanks!

  8. #8
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Isn't that what I did?
    Dave

  9. #9
    Join Date
    Apr 2010
    Posts
    9
    Quote Originally Posted by dav1mo View Post
    Isn't that what I did?
    Dave
    My task is this:

    1)Please, write the composite key for this table
    2) What columns you recommend to use for composite key?

  10. #10
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    as I said, suggestions have already been given, by both blindman and myself. In fact, you quoted the suggestion I gave you.
    Dave

  11. #11
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    My task is this:

    1)Please, write the composite key for this table
    2) What columns you recommend to use for composite key?
    Is this your homework?
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  12. #12
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    How about asking this dude what a composite key is? He might be a spambot just looking at the repitition
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •