Add primary key to existing table

0 votes

I have an existing table called Persion. In this table I have 5 columns:

  • persionId
  • Pname
  • PMid
  • Pdescription
  • Pamt

PersionId and Pname were the primary keys I chose for this table when I was creating it.

I now want to add PMID as a new column to the primary key. How do I construct this in an ALTER statement? (The table already contains 1000 records.)

Can someone help me with this?

Sep 10 in Database by Kithuzzz
• 11,640 points
15 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
1 answer

Do I need to add primary key in each and every table?

Hi Shraddha, You have a doubt to add ...READ MORE

answered May 29, 2019 in Database by sampriti
• 1,120 points
348 views
0 votes
0 answers

Add Foreign Key to existing table

I want to add a Foreign Key ...READ MORE

Sep 3 in Database by Kithuzzz
• 11,640 points
35 views
+1 vote
1 answer

Do I need to mention primary key for each table?

Hi Pritha, First, there is no hard and ...READ MORE

answered Jul 4, 2019 in Database by sampriti
• 1,120 points
341 views
0 votes
0 answers

Add Auto-Increment ID to existing table?

I already have a database with the ...READ MORE

Sep 8 in Database by Kithuzzz
• 11,640 points
9 views
0 votes
1 answer

Add a column with a default value to an existing table in SQL Server

Syntax: ALTER TABLE {TABLENAME} ADD {COLUMNNAME} {TYPE} {NULL|NOT ...READ MORE

answered Sep 12 in Database by narikkadan
• 19,680 points
52 views
0 votes
1 answer

How to generate the statement CREATE TABLE for an existing table in postgreSQL?

Generate table creation statement for an existing ...READ MORE

answered Feb 9 in Database by Neha
• 8,920 points
711 views
0 votes
1 answer

Rename column SQL Server 2008

Use sp_rename EXEC sp_RENAME 'TableName.PreviousColumnName' , 'NewColumnName', 'COLUMN' See: SQL SERVER ...READ MORE

answered Feb 23 in Database by Vaani
• 7,020 points
49 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9 in Database by Kithuzzz
• 11,640 points
159 views
0 votes
0 answers

Simple DateTime sql query

How do I query the DateTime database ...READ MORE

Aug 12 in Database by Kithuzzz
• 11,640 points
22 views
0 votes
0 answers

Calculate time difference in minutes in SQL Server

I require the minutes-based time difference between ...READ MORE

Aug 13 in Database by Kithuzzz
• 11,640 points
107 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP