An entity relationship diagram models the relationships between entities in a database. It shows entities, attributes, and different types of relationships between entities including mandatory, optional, one-to-one, one-to-many, many-to-many, and recursive relationships. Many-to-many relationships should be avoided and can be resolved by introducing a joining entity to split them into two one-to-many relationships.