# EERD

EERD stands for Extended Entity Relationship Diagram, which is an extended version of the Entity Relationship Diagram (ERD). An EERD is often used to visualize the structure and relationships between entities in a database.

In an EERD, different symbols are used to represent the different elements of a database. Two important symbols are the Primary Key (PK) and the Foreign Key (FK).

Primary Key (PK): A Primary Key is a unique identifier for an entity in a database. It is used to identify and distinguish rows in a table. In an EERD, a PK is usually indicated with an underscored attribute or a special symbol, such as a Key icon.

Foreign Key (FK): A Foreign Key is an attribute in a table that refers to the Primary Key of another table. It is used to define relationships between tables. In an EERD, an FK is usually indicated with a dotted line pointing to the PK of another entity.

Here is an example to clarify the concept of PK and FK:

Suppose we have a database with two tables: "Orders" and "Customers". The "Orders" table has a PK called "order_id", while the "Customers" table has a PK called "customer_id". To define the relationship between these two tables, we can add an FK called "customer_id" to the "Orders" table, which refers to the PK "customer_id" in the "Customers" table. This allows us to link the orders of each customer to the correct customer information.

![EERD](../assets/EERD.png)