Entity:
- definition: representation of a class of an object
- representation: represented as a rectangle, and a name on top
- example: the name of the database
Attributes
- definition: property/properties that describes the entity
- representation: text within the rectangles
- example: column of database
Relationships
- depicted by a line that connects the two entities
- One line means one relationship
- Crow’s foot means many relationships
- Circle means that it’s optional
- mandatory means that there must be a relationship
One to many
erDiagram
PERSON ||--o{ PASSPORT : id
PERSON {
int id
string name
}
PASSPORT {
int id
string number
}
A person can have many passports, or none. A passport however, must be associated with one person.