Mermaid Full Examples with Code and Descriptions:
1:1 Relationship
erDiagram
Person {
int PersonID PK
}
Passport {
int PassportID PK
}
Person ||--|| Passport : "owns"
- Description: One
Personhas onePassport, and onePassportis assigned to onePerson.

1:N Relationship
erDiagram
Customer {
int CustomerID PK
}
Order {
int OrderID PK
int CustomerID FK
}
Customer ||--o{ Order : "places"
- Description: A
Customercan place manyOrders, but eachOrderbelongs to exactly oneCustomer.

M:N Relationship
erDiagram
Student {
int StudentID PK
}
Course {
int CourseID PK
}
Enrollment {
int EnrollmentID PK
int StudentID FK
int CourseID FK
}
Student o{--o{ Enrollment : "enrolls in"
Course o{--o{ Enrollment : "has"
- Description: A
Studentcan enroll in manyCourses, and aCoursecan have manyStudents. This relationship is managed via the junction tableEnrollment.

This table and examples illustrate how to represent all major relationship types using Mermaid with crow’s foot notation!
