DBMS - KCS501 - Notes Unit-1
DBMS - KCS501 - Notes Unit-1
Now in the EMPLOYEE table, Department_Id is the foreign key, and both
the tables are related.
Difference Between Primary key & Foreign key
Primary Key Foreign Key
Helps you to uniquely identify a record in the table. It is a field in the table that is the primary key of another
table.
Primary Key never accept null values. A foreign key may accept multiple null values.
Primary key is a clustered index and data in the DBMS A foreign key cannot automatically create an index,
table are physically organized in the sequence of the clustered or non-clustered. However, you can manually
clustered index. create an index on the foreign key.
You can have the single Primary key in a table. You can have multiple foreign keys in a table.
5. Composite key
Any key with more than one attribute is called Composite key.
6. Compound key
If a Composite key has at -least one attribute that is a foreign key, then it is
called a compound key.
7. Surrogate Key
If a relation has no attribute which can be used to identify the data stored
in it, then we create an attribute for this purpose.
It adds no meaning to the data but serves the sole purpose of identifying
rows uniquely in the table.
What is EER?
Super class or subclass.
Generalization
Specialization
Aggregation
What is Extended ER Model?
Generalization
(bottom-up)
Specialization
(top-down)
Aggregation