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:
- 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.
- Click the “Import” button inside the Toolbox. An import window will appear.
- Select the Database Management System (DBMS) you use.
- Use the provided query to generate shapes of the individual tables in your database.
- 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.”
- 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.
- Click in the ERD shape library. Alternatively, navigate to File > Import Data > Salesforce > Schema Import OR File > Import Data > Entity Relationship > Salesforce Import.
- In the dialog that pops up, click .
- The next window will prompt you to sign in to Salesforce. Click "Continue."
- 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.
- 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.
- Beneath “Import Options,” select between “Show only relationships” or “Show all object details.” Click .
To create an ERD manually:
- Open the Shape Library Manager and make sure the Entity Relationship library is turned on.
- Drag the desired entity object onto the canvas.
- 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.
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.
- Select the line you would like to modify.
- 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.
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.
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.
Export your ERD to the DBMS of your choice (with the exception of connections between tables).
To export your entire page:
- In the Entity Relationship shape library found in the Toolbox, click “Export.”
- A dialog will appear. Choose your DBMS from the menu. The text field below will produce the correct statement for the entire page.