Can I have multiple primary keys in a single table

0 votes

Can I have multiple primary keys in a single table?

Oct 25, 2018 in Database by Neha
• 6,300 points
3,805 views

1 answer to this question.

0 votes

A Table can have a Composite Primary Key which is a primary key made from two or more columns. For example:

CREATE TABLE userdata (
  userid INT,
  userdataid INT,
  info char(200),
  primary key (userid, userdataid)
);
answered Oct 25, 2018 by Frankie
• 9,830 points

Related Questions In Database

0 votes
1 answer

How can I define a composite primary key in SQL?

A primary key is unique and it ...READ MORE

answered Feb 21, 2022 in Database by Vaani
• 7,070 points
1,387 views
0 votes
0 answers

How to DROP multiple columns with a single ALTER TABLE statement in SQL Server?

In one ALTER TABLE statement, I would ...READ MORE

Sep 2, 2022 in Database by Kithuzzz
• 38,000 points
748 views
0 votes
0 answers

How can I get column names from a table in SQL Server?

I want to search for every column's ...READ MORE

Sep 3, 2022 in Database by Kithuzzz
• 38,000 points
413 views
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
1,481 views
0 votes
1 answer

Which one is suitable for real time big database- Primary Key or Unique Index?

What is a unique index? A unique index ...READ MORE

answered Oct 12, 2018 in Database by Frankie
• 9,830 points
1,873 views
0 votes
0 answers

how to design db schema of an e-learning platform in dynamodb?

I am designing No-SQL DB schema for ...READ MORE

Apr 19, 2022 in AWS by Rahul
• 9,680 points
730 views
0 votes
1 answer

Is it possible to access Couchbase by terminal?

What you want to accomplish isn't possible ...READ MORE

answered Apr 29, 2018 in DevOps & Agile by DareDev
• 6,890 points
769 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by Parth
• 4,640 points
1,913 views
0 votes
1 answer

How to cache data in a MVC application?

Reference the System.Web dll in your model ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
1,833 views
0 votes
1 answer

How do I enable Oracle automatically on systemboot?

To enable the database service to start ...READ MORE

answered Oct 5, 2018 in Database by Frankie
• 9,830 points
736 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP