When related tables are stored in the database - the relation is based on the system/application or subject and the relationship is established between tables using Primary Key and Foreign Key along with referential constraints, we call it as Relational Database Management System (RDBMS).
PRIMARY KEY - It creates UNIQUE INDEX on selected COLUMN. This restricts inserting duplicate records for column with Primary Key. Unique Index helps to improve the search performance.
FOREIGN KEY - It creates NON-UNIQUE INDEX on selected COLUMN. This Key works in relation with Primary Key, the relation between two tables gets established using Primary Key and Foreign Key.