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

0 votes
I have a big doubt, For each and every table in my database do I need to add primary key?
May 29 in Database by Shraddha
18 views

1 answer to this question.

Your answer

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

Hi Shraddha,

You have a doubt to add a primary key in your table or not? Or is it mandatory to add the primary key?

See, do you know why we use the primary key?

  • We use primary key to restrict the data repetition so that our memory storage will not be wasted.
  • If You need your table to be joinable on something that time we need primary key
  • If you want your table to be clustered, you need some kind of a primary key.

But in database we can create a table without adding the primary key, but experts always preferred tables with primary key.for these facilities.

I hope this answer will help you out ,

Thank you, 

answered May 29 by Sampriti
• 620 points

Related Questions In Database

0 votes
1 answer

Can I have multiple primary keys in a single table?

A Table can have a Composite Primary Key which ...READ MORE

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

What do ‘Record’, ‘Field’ and ‘Table’ mean in terms of a database?

You can refer to the following definitions ...READ MORE

answered Nov 12, 2018 in Database by darklord
• 6,140 points
24 views
0 votes
1 answer

What are the ways to get the count of records in a table

To count the number of records in ...READ MORE

answered Sep 26, 2018 in Database by darklord
• 6,140 points
39 views
0 votes
1 answer
0 votes
1 answer

How to sort the data in sql ?

Hi Akash,  If you want to sort ...READ MORE

answered May 29 in Database by Sampriti
• 620 points
8 views
0 votes
1 answer

Why is not preferable to use mysql_* functions in PHP?

The reasons are as follows: The MySQL extension: Does ...READ MORE

answered Sep 7, 2018 in Database by DataKing99
• 8,100 points
30 views
0 votes
1 answer

Find values in a comma separated string in a MySQL query

You can add commas to the left and ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,140 points
873 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,140 points
104 views
0 votes
1 answer

How will I get all the rows from my table where name starts with 's' and ending with 'I'?

Hi Santanu, I understand your problem, You can try ...READ MORE

answered May 28 in Database by Sampriti
• 620 points
21 views
0 votes
1 answer

What is the best way to fetch data from table?

Hey Shraddha, I understand your doubts about fetching ...READ MORE

answered May 24 in Database by Sampriti
• 620 points
14 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.