Entity Relationship Diagrams

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.

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.

    Lucidchart ERDs open shape manager
  2. Click the “Import” button inside the Toolbox. An import window will appear.

    Screen_Shot_2018-07-13_at_3.30.57_PM.png
  3. Select the Database Management System (DBMS) you use.

    Screen_Shot_2018-07-13_at_2.46.50_PM.png

  4. Leave the provided query as it lets you generate shapes for your own query.

    Screen_Shot_2018-07-13_at_2.47.11_PM.png

  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.” 

    Screen_Shot_2018-07-13_at_2.47.36_PM.png   
     
  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.

Screen_Shot_2018-07-13_at_3.19.18_PM.png

With the new Schema Import from Salesforce, admins can map out the architecture of their Salesforce instances. 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.

    salesforce_import_6.png

  3. In the next window, click "Allow" to grant Lucidchart permission to access to your Salesforce account. You can revoke access at any time in your personal settings.
  4. 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.

    salesforce_import_7.png

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

    salesforce_import_8.png

To create an ERD manually:

  1. Open the Shape Library Manager and make sure the Entity Relationship library is turned on.
  2. Drag the desired entity object onto the canvas.
  3. 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.
  4. 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.

    Lucidchart ERDs open shape manager

    Screen_Shot_2018-07-13_at_3.30.57_PM.png

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

  1. Select the line you would like to modify.
  2. Use the drop-down menu in the properties bar to select the cardinality or other formatting option of 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

You can create a relationship line 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

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

Screen_Shot_2018-07-13_at_3.30.57_PM.png

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 create statement for the entire page.
    Screen_Shot_2018-07-13_at_3.31.20_PM.png


Related Articles
Access More Shapes
Tables
UML Sequence Markup
Style a Shape