Computer Science

Differentiate between Primary key and Unique constraints.

SQL Queries

2 Likes

Answer

Primary keyUnique constraints
A Primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row in a table.UNIQUE constraint ensures that no two rows have the same value in the specified column(s).
Primary Keys do not allow NULL values.Unique Constraint allows NULL values.
There can be only one Primary Key in a table.Multiple Unique Constraints can exist in a table.

Answered By

3 Likes


Related Questions