Entity Relationship Diagrams (ERDs)

Create entity relationship diagrams (ERDs) with customized text, styling, and relationships between fields. Automatically generate database tables and schemas using our SQL import feature.

Watch this video to learn more about ERDs, then read the tutorial below to learn how to make one in Lucidchart.

Entity Relationship Diagrams (ERDs) are visual representations of databases that show how the elements within a database are related to each other. An ERD is made up of two object types - entities and relationships. The relationships have special line endings called cardinalities that describe how two elements of the database interact with each other.


In Lucidchart, you can either generate an ERD automatically based on imported data or create one manually or from a template. To create one from scratch, you will need to first enable the ERD shape library from the shape manager.


When working with ERD shapes, an advanced shape bar will appear at the top of your canvas with special settings that allow you to edit your diagram.


The ERD import feature uploads all of your database tables and schemas directly to your Toolbox. When you drag related tables onto the canvas, Lucidchart draws relationship lines automatically. You can import updated database files at any time, and the fields will be updated in the Toolbox and on the canvas.

To import your database components, follow these steps:

  1. Open the Shape Library Manager by clicking “+ Shapes” in the Toolbox or by hitting the “M” key on your keyboard. Make sure the Entity Relationship library is turned on.

  2. Click the “Import” button inside the Toolbox. An import window will appear.

  3. Select the Database Management System (DBMS) you use.

  4. Use the provided query to generate shapes of the individual tables in your database.

  5. Import your .CSV, .TSV, or .TXT file and upload it by clicking the “Choose File” button in the import window. Alternatively, copy and paste the query results in the open text area. Click “Import.” 

  6. Lucidchart immediately converts the imported query into a list of databases, tables, and schemas and organizes the list in your Toolbox. Each collapsible section of the Toolbox represents a database. The names inside a section correspond with database tables. An additional subsection would indicate a schema.

In the example below, a TSV file containing multiple databases was imported. When “shard_servers” and “Shards” were both dragged to the canvas, the relationship was automatically drawn.


With the new Schema Import from Salesforce, admins can map out the architecture of their Salesforce instances.
Note: This feature may not be available to all account levels. If you encounter a paywall, please contact our sales team.
To import your schema, follow the steps below.
  1. Click salesforce_import_1.png in the ERD shape library. Alternatively, navigate to File > Import Data > Salesforce > Schema Import OR File > Import Data > Entity Relationship > Salesforce Import.

    salesforce_import_2.png salesforce_import_3.png salesforce_import_4.png
  2. In the dialog that pops up, click salesforce_import_5.png.

  3. The next window will prompt you to sign in to Salesforce. Click "Continue."
  4. If you have not linked to Salesforce before, the next window will prompt you to grant Lucidchart permission to access to your Salesforce account. Click "Allow" to do so. You can revoke access at any time in your personal settings. Note: If you encounter an error message after this step, please check your login IP Ranges under your Salesforce user profile and make sure that those ranges are not restricted. 
  5. In the next window, select which Salesforce objects you would like to import into Lucidchart. Search for specific objects using the search bar at the top. If no objects are found, you will be prompted to adjust your search term.

  6. Beneath “Import Options,” select between “Show only relationships” or “Show all object details.” Click salesforce_import_9.png.

You can easily create an ERD manually by enabled the ERD shape library, dragging out shapes, and adding relationships, text, and styling.

When you click on a table, the Advanced Shape Menu will drop down from the top of the editor. Use the Advanced Shape Menu to change the number of fields in a table.

Lucidchart ERDs add or remove fields
Double-click on the text to enter text edit mode. Once you have selected a text box, you can easily move between text boxes by pressing Tab on your keyboard to go forward or Shift+Tab to go backward. Press Enter or click off the object when finished.
To change the size of an object, simply click and drag from one of the corners and extend to either side. As you move an object, the columns will auto-adjust to fit the content inside.

You can create a relationship line between two entities by clicking and dragging from any dot on an object. You can drag the line to another shape and create a relationship to a specific field OR release the cursor over empty canvas to auto-prompt adding a new entity object.

If you decide to add or subtract fields after you have created a relationship, any connected lines will move with the fields they are attached to. There is no need to redraw them.

Lucidchart ERDs create relationships between objects

Lucidchart ERDs create relationships between objects
To add formating to the lines of your ERD, select the line and use the drop-down menu in the properties bar to assign new cardinalities to each of the line's endpoints. The default line for an ERD is pictured below.

Lucidchart ERDs format lines
You can use the property bar to easily style entity objects while they are selected.
    • Modify text formatting, size, color, font, and alignment.
    • Adjust line thickness and color.
    • Select a fill color, gradient, or image.

Add shading to alternate rows of a table or to the table header using the Advanced Shape Menu.

Lucidchart ERDs add style to your ERD

Export your ERD to the DBMS of your choice (with the exception of connections between tables).


To export your entire page:

  1. In the Entity Relationship shape library found in the Toolbox, click “Export.”
  2. A dialog will appear. Choose your DBMS from the menu. The text field below will produce the correct statement for the entire page.
Why aren’t the relationships between the shapes of my diagram showing up?
When Lucidchart is not drawing lines between the entities of your imported ERD, it is likely that your data file does not indicate the relationships. To check this, please open your data file and make sure that the cells at the end of each row are populated with information about the relationships between entities.

Design, plan, and understand relational databases with Entity Relationship Diagrams (ERDs) in Lucidchart!

ERDs allow you to visualize the relationships between your databases so you can better understand your data’s organization and functions. Our data import feature allows you to pull your data directly from Database Management Systems such as MySQL, Oracle, PostgreSQL, SQLServer, and even Salesforce. Alternatively, you can use our ERD shape library to manually build your ERD from scratch directly in Lucidchart.

This section describes how you can manually build an ERD to understand the relationships between six school databases:

  1. Students
  2. Groups
  3. Teachers
  4. Subjects
  5. Subject Teachers
  6. Marks

Each database contains information that relates to information in another database, but to avoid confusion, the data is organized into separate databases. However, there are instances where it could be useful to understand the relationships between the data. For example, you might want to see which students in one “group” have a specific teacher for their math class. You know this information is available somewhere in your databases, but without ERDs, it can be difficult to understand where this data is actually stored and how to find it quickly. ERDs set you up for success because they allow you to visualize and, in turn, better understand how your databases relate to each other.

For this example you would create an ERD like this:


Here, you can find one entity shape for each database (“Marks,” “Students,” “Groups,” “Subjects,” “Subject Teacher,” and “Teachers”). Beneath each entity, you find various attributes, or additional information, that are directly related to the parent entity. These attributes correspond to columns in a database, while entities correspond to rows. Notice how each student has basic attributes such as a unique student ID, a first name, and a last name. Each student is also a part of a group, which is why you see a “GroupID” attribute under the “Students” entity. The same is true for the “Teachers” entity; each teacher has a unique ID (“TeacherID”), a first name, and a last name. These entity shapes give you a basic outline of the information you can expect to find in each respective database without the need to open databases individually.

You probably also noticed the lines that connect the entities to one another. These line connections represent the relationships between databases, or entities. Each line connection also contains different symbols to reflect the type of relationship between the entities.

Use this guide to understand the cardinality each symbol represents:


By connecting your entity shapes with these lines, you create a simple visualization that specifically explains how databases relate to one another.

Take a look at the “Groups” entity in the ERD shown above, for example. You can see that although the “Groups” entity only contains two attributes (“GroupID” and “Name”), there are two lines which connect to the entity: one from the “Students” entity and one from the “SubjectTeacher” entity.


You can see that both the “Students” and “SubjectTeacher” entities contain an attribute called “GroupID,” and the lines that connect from the “GroupID” attributes within each entity show a direct relationship to the “Groups” entity. In other words, the lines show that the “GroupID” attributes in the “Students” and “SubjectTeacher” entities are the same as the “GroupID” attribute in the “Groups” entity.

Additionally, you can reference the cardinality guide shown above to determine a few important details about the relationships between these entities.

For example, this ERD shows:

  • Each group has at least one student, but could have more students, as shown by the Screen_Shot_2019-10-08_at_3.06.52_PM.pngline connection.
  • Each student can be a part of zero to many groups, as shown by the Screen_Shot_2019-10-08_at_3.08.50_PM.png line connection.
  • Each subject teacher has one group, as shown by the Screen_Shot_2019-10-08_at_3.09.50_PM.png line connection.
  • Each group has many subject teachers, as shown by the Screen_Shot_2019-10-08_at_5.25.04_PM.png line connection.

As you can see, ERDs empower you to understand key features about your databases through easy visualizations, and you don’t even have to worry if something changes. Lucidchart allows you to change the line connection format in a few steps. For more complex database structures, you can even add colors and line styling to make your ERD easier to navigate. When you’re done, don’t forget to export your ERD to your favorite DBMS or share your document with collaborators.

Try it today, and see for yourself how ERDs can improve your workflow and database organization! Click here to start from the blank template used in this example, or browse additional ERD templates here.

Related Articles

Access More Shapes
UML Sequence Markup
Style a Shape