PRIMARY KEY is not madatory for a table?
What happens if we do not add Primary Key to the code? I tried executing and ran succesfully. Should we only add the primary key when we want to define certain relationships?
1 answers ( 0 marked as helpful)
Hi Rahul!
Good to hear from you.
If you don't add a primary key to an SQL table, there will be no enforcement of uniqueness, allowing duplicate rows. The database won't create implicit indexes, which could lead to slower query performance.
Without a primary key, there is no guarantee that each row can be uniquely identified, which can result in data integrity issues.
Best,
Ned