1Primary Key :
2It is unique column in every table in a database
3It can ONLY accept;
4 - nonduplicate values
5 - cannot be NULL
6Foreign Key:
7It is a column that comes from a different table and
8using Foreign key tables are related each other
9It is the primary key of another table
10It can be duplicate or null for another table
11
12Unique Key:
13Only unique value and also can contain NULL
1Primary Key :
2It is unique column in every table in a database
3It can ONLY accept;
4 - nonduplicate values
5 - cannot be NULL
6Foreign Key:
7It is a column that comes from a different table and
8using Foreign key tables are related each other
9It is the primary key of another table
10It can be duplicate or null for another table
11
12Unique Key:
13Only unique value and also can contain NULL
14
1PrimaryKey:-
2
3A primary key constrain is a column or group of columns that uniquely identifies every row in the table of the relational database management system.
4It cannot be a duplicate, meaning the same value should not appear more than once in the table.
5
6Foreign key:-
7A table can have more than one primary key.
8Primary key can be defined at the column or the table level.
9If you create a composite primary key, it should be defined at the table level.
10Foreign key is a column that creates a relationship between two tables. The purpose of the Foreign key is to maintain data integrity and allow navigation between two different instances of an entity. It acts as a cross-reference between two tables as it references the primary key of another table.
11Every relationship in the database should be supported by a foreign key.