composite primary keys with amendment in table

  • hi plz help me

    i want help from u guys

    example

    grade internal grade sno amendno manpower required cost

    developer developer1(1year exp) 1 0 3 10000

    developer developer2(2year exp) 2 0 2 12000

    developer developer3(3 year exp) 3 0 1 15000

    senior developer senior grade1 1 0 4 100000

    senior developer senior grade1 1 1 3 750000

    like that in a table.

    can anyone help me for which columns primary columns is need.

    how to perform these operations in query wise in T sql.

    regards

    BAlaji.N

  • silentbeautybalaji (10/7/2013)


    hi plz help me

    i want help from u guys

    example

    grade internal grade sno amendno manpower required cost

    developer developer1(1year exp) 1 0 3 10000

    developer developer2(2year exp) 2 0 2 12000

    developer developer3(3 year exp) 3 0 1 15000

    senior developer senior grade1 1 0 4 100000

    senior developer senior grade1 1 1 3 750000

    like that in a table.

    can anyone help me for which columns primary columns is need.

    how to perform these operations in query wise in T sql.

    regards

    BAlaji.N

    Hi and welcome to SSC. We can't even take a shot at what you should use for a primary key. To be honest it doesn't like you have a very good candidate key here at all.

    You might want to start here so you understand what a primary key is. http://www.w3schools.com/sql/sql_primarykey.asp

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • silentbeautybalaji (10/7/2013)


    can anyone help me for which columns primary columns is need.

    My guess is that data modeling for this project is half cooked - at best.

    Do you have an E/R model?

    Either way, when selecting a Primary Key, a Natural PK I should add, you should ask yourself; "What column/s in this table uniquely identify a member of this entity?"

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Viewing 3 posts - 1 through 2 (of 2 total)

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