An ERD is a diagram that helps you to see how different entities relate to each other in a system. These diagrams are used when you design a new system to help the development team to understand how the database should be structured. ERD diagrams are also useful to help you to understand how existing systems work and for finding and resolving problems.
These diagrams use a defined set of shapes and symbols (rectangles, diamonds, ovals, connecting lines) that let you document the logical structure of your database. The shapes and symbols provide a common language that makes it easy for everybody to see and understand how the system works, where the data is located, and how to access it when they need it.
This common graphical language is analogous to written language, with entities acting like nouns and the relationships and connectivity acting like verbs.
Entity
An entity is any kind of data object that is important to your business. These objects can be computers, printers, employees, customers, places, events, concepts, and so on.
An entity is like a noun. It is a thing that has data stored about it. For example, a pizza order and the customer who orders it are entities that can be stored in a database.
You can put entities into entity sets, which are collections of entities that share common attributes. For example, you might have a lot of pizza entities in one data set that share attributes such as size, crust, sauce, cheese, etc. But the values for many of these attributes might be different, such as crust type (thin, deep dish) and amount of sauce (light, normal, extra).
Attributes and relationships
Attributes are what define the properties of the entities in your database. Using a pizza as an example of an entity, the attributes might be medium, deep dish, light sauce, extra cheese, and pepperoni. In addition, you might have a customer entity set that has different values for name, address, payment information, and so on.
When entities and attributes have been defined, you can set up the relationships between them. A relationship describes the connection or association between one or more instances of entity types. Relationships can be thought of as verbs or verb phrases.
So a customer named Bob (entity, attributes) might order a medium deep dish pepperoni and have it delivered to his house (entity relationship).
This type of information is useful for the pizza restaurant and the customer. The restaurant can send the customer targeted ads based on previous orders. The customer can quickly order the next time they visit the restaurant website because their information, including previous orders and payment information, is stored in the database.
Types of entity relationship diagrams
There are several different types of ERDs you can use. Here we’ll discuss three of the most well-known types and the benefits of using each.
Crow’s foot
This method for creating ERDs uses crow’s foot notation. With this notation, boxes represent entities and lines represent the relationships between the boxes. There are different shapes at the end of these relationship lines that represent the relationship cardinality—the maximum number of times an instance in one entity can relate to instances of another entity.
There are three main cardinal relationships:
One-to-one: One customer orders one pizza.