Entity Relationship Diagram Tutorial
ERDs, or entity-relationship diagrams, are charts that model the relationship between database entities. To learn how to build an entity-relationship diagram from beginning to end, check out this tutorial.
Lucidchart was designed to create technical diagrams that are both beautiful and effective. Use the app to edit, collaborate on, and publish ERDs—all from a web browser.Try it now Sign up free
How to Make an ERD
Before you start drawing an entity-relationship diagram, be sure to review what an ERD is. When you understand the basic components of database modeling, it’s time to begin.
CHOOSE A MEDIUM
It’s important to pick the right ERD tool for your project. Simple ERDs can be built with a pen and paper, but nearly every complex ER diagram is created with computer software. Some programs are more complicated or expensive than others, so choose wisely.
For the purposes of this guide, we’ll proceed as though you’re using Lucidchart. Our program is fast, responsive, and comes with useful features like automatic ERD creation from a database.
To import ERD information from a database, see this tutorial and this video. Our software will quickly generate an entity-relationship diagram with just a few hints from the user. You can choose from several database management systems; plus, updated database files can be imported at any time to refresh the information in your document.
UNDERSTAND DATA MODELS
Before you start drawing, you should determine which level of ERD you wish to create. There are three distinct entity-relationship models: conceptual models, logical models, and physical models. Conceptual models are the simplest and most high-level diagrams; most entity-relationship diagrams begin as a conceptual model. Your diagram will increase in complexity and specificity as you move from conceptual to logical to physical. The physical model is true to its name—it will demonstrate to developers and other users how to physically add the model's information to a database. See our page on ER diagram symbols and meanings for more information on data models and ERD symbols.
Keep in mind that entity-relationship shapes are grouped into 3 main categories: entities, relationships, and attributes. Entities are objects or concepts that are associated with important data—like a customer, store, or supervisor—while relationships demonstrate the link between entities. Attributes represent properties of an entity, such as a customer’s phone number or home address.
You’ll need an in-depth understanding of the system to identify these elements. Once you know what they are, group them appropriately by:
- Defining entities - these are typically nouns, e.g. customer, supervisor, location, or promotion. Entities are represented by a rectangle shape in a conceptual model, and are known and represented as tables in a logical or physical model.
- Defining relationships - these are usually verbs, e.g. assign, associate, or track. Relationships are demonstrated with a diamond shape in a conceptual model, and as stylized lines in a logical or physical model.
- Adding attributes - these describe characteristics of the entity. Attributes are symbolized by ovals in a conceptual model and as table elements in a logical or physical model. Attributes are known as keys in the physical model.
When you understand entities, relationships, and attributes, you should determine which data model is right for you. Consult the chart below to see which elements are included in each data model.
Drag out the appropriate shapes from the toolbox and title each element. To access simple shapes—rectangles, diamonds, and ovals—click "More Shapes" within Lucidchart and turn on the UML Entity Relationship shape library. To find tables, turn on the Entity Relationship shape library. Generally, tables are utilized in physical data models, while geometric symbols are employed in conceptual data models. Aspects from either model may spill over into the logical data model, depending on the notation style you choose.
Once your tables or entities are on the page, connect them with lines to show their relationship. A single line signifies a relationship between entities, and a double line indicates a constraint that forces total participation in a relationship. ERDs use specialized connectors that express both cardinality and ordinality. Cardinality specifies how many instances of an entity relate to another instance of an entity, while ordinality describes the relationship as either mandatory or optional.
In Lucidchart, expressing cardinality is as simple as drawing a line. Then, change the line’s style to denote a one-to-many relationship, one-to-one relationship, zero-or-one relationship, or any other option you choose.
This guide can’t cover all the potential inefficiencies in an ERD, but we can offer suggestions to minimize confusion. Since most creators of entity-relationship diagrams are students or professionals in the computer science field, it might be wise to consult a professor or supervisor with further questions.
Follow these steps to create an easy-to-read diagram:
- Ensure that each entity only appears once per diagram.
- Provide simple and accurate names for every entity, relationship, and attribute on your diagram.
- Look closely at the relationships between entities. Make sure that each connection is necessary and unique.
- Use colors to emphasize important relationships and related elements of the diagram.
Entity-relationship diagrams are essential frameworks for creating and manipulating databases. In order to be useful, however, they must be understood by a diverse audience. A well-designed ER diagram should easily communicate meaning to designers, developers, managers, and end users. Walk through your diagram with someone you trust. This process will help you find inefficiency and inconsistency.
With Lucidchart, you can create great-looking entity-relationship diagrams for work or school. Our software is platform-agnostic, so users can work from any device or location. Try it and see for yourself!