Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

composite primary keys with amendment in table Expand / Collapse
Author
Message
Posted Monday, October 7, 2013 6:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 13, 2014 3:37 AM
Points: 1, Visits: 113
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
Post #1502108
Posted Monday, October 7, 2013 8:20 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:04 PM
Points: 13,086, Visits: 12,553
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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1502160
Posted Monday, October 7, 2013 2:51 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,065, Visits: 4,639
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.
Post #1502379
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse