Dr.ERD를 사용하려면 JavaScript를 활성화해야 합니다. Dr.ERD는 Mermaid를 지원하는 로컬 우선 ERD 편집기입니다.

How to create a free ERD without an account (beginner tutorial)

This walkthrough is for people designing their first database. With the free Dr.ERD editor you build a three-table ERD locally, without creating an account, and save it as a .drerd file on your own computer.

Current article: Beginner ERD guide

1. What an ERD, a table, and a column are

An ERD (entity relationship diagram) is a drawing of a database structure. Each box is a table, and each line inside a table is a column. One thing you want to store becomes a table, and its properties become columns. Each row is a single record that holds one value per column.

  • Table: a set of records of the same kind, such as members, orders, or order items.
  • Column: an attribute the table stores, such as name or created_at.
  • Row: one actual record. The structure stays the same as the number of rows grows.

2. Primary keys, foreign keys, and 1:N

A primary key (PK) identifies each row, and a foreign key (FK) points at another table’s key to connect the two tables. When one member can place many orders, the relationship is member 1 : order N. The child side allows a member who has no orders, so it is zero or more (0..N). Both relationships in this lesson are non-identifying: the parent key stays out of the child primary key.

  • A foreign key column must use the same type as the column it references: members.id is BIGINT, so orders.member_id is BIGINT too.
  • Type the id values by hand in this lesson and leave identity (auto-increment) off.
  • N:M relationships do not get an automatic junction table. Create one yourself when you need it.
  • A parent table needs a primary key before you can connect a relationship to it.

3. Prepare a workspace without an account

Dr.ERD runs in Chrome or Edge with nothing to install. Choose a workspace folder and start modeling without signing up, and ERDs in your local workspace folder are not uploaded to a server by default. Editing with a team requires Google sign-in, and team documents are saved to the team you select. AI chat is optional: only messages you write after configuring your own API settings send the current ERD context to the provider you choose.

  1. Select Start editing to open the workspace.
  2. Use Choose folder to pick where .drerd files are saved.
  3. Allow access when the browser asks for folder permission.
  • Desktop Chrome and Edge support folder picking and saving.
  • Open the same folder again to see earlier files in the file list.

4. Create a model and pick PostgreSQL 18

Select New model above the file list to create the model for this lesson, then choose PostgreSQL 18 as the target database so it matches the example. Confirming opens an empty canvas; no table is created for you.

  1. In the file list, select New model.
  2. Enter first-erd as the file name.
  3. Choose PostgreSQL 18 for the target database, then select Confirm.
  4. On the empty canvas, select the Table button in the toolbar. Tables can only be placed while that button is active.
  5. Click an empty spot on the canvas to place the first table.

5. Build three tables and their columns

Step 4 already placed the first table, so here you add the remaining two to finish the members, orders, and order_items tables. A new table starts with the common columns created_at and updated_at, so delete both of those columns from all three tables, including the one from step 4, before adding the lesson columns. Then use Add column to add a row, enter its physical name and type, and select Set PK on the id column. Add orders.created_at yourself in this step and set its type to TIMESTAMP; because you removed the default column, the name is not duplicated. The list below is every column in this lesson, so compare it with your model and check that nothing is missing.

  1. Select the Table button in the toolbar, then click an empty spot on the canvas to place a table. Step 4 already placed the first table, so place the remaining two this way for three tables in total.
  2. Open a table for editing and use the trash (Delete columns) button on the right of each column row to delete created_at and updated_at from all three tables.
  3. Add a column with Add column, then enter its physical name and type.
  4. Fill in length and scale where the type needs them, such as VARCHAR(100) or NUMERIC(12,2).
  5. Add orders.created_at with Add column and set its type to TIMESTAMP. The default common column is already gone, so the name is not duplicated.
  6. Select Set PK on the id column to make it the primary key.
  7. Name the tables members, orders, and order_items.
  • members: id BIGINT (PK), name VARCHAR(100)
  • orders: id BIGINT (PK), member_id BIGINT (FK), created_at TIMESTAMP
  • order_items: id BIGINT (PK), order_id BIGINT (FK), product_name VARCHAR(100), quantity INTEGER, unit_price NUMERIC(12,2)
  • Both common columns a new table starts with (created_at and updated_at) are removed, and only orders.created_at is added back with the type TIMESTAMP, so the three tables hold exactly the ten columns listed above.
  • The three tables hold ten columns in total, and they must still hold ten after you connect the relationships.
  • The Mermaid below is the finished model in text form. Check that its physical names and types match the list above.
erDiagram
  members {
    BIGINT id PK
    VARCHAR(100) name
  }
  orders {
    BIGINT id PK
    BIGINT member_id FK
    TIMESTAMP created_at
  }
  order_items {
    BIGINT id PK
    BIGINT order_id FK
    VARCHAR(100) product_name
    INTEGER quantity
    NUMERIC(12,2) unit_price
  }
  members ||..o{ orders : "places"
  orders ||..o{ order_items : "contains"

6. Connect the two relationships

Select the 1:N button under Relationship tools, then click the parent table and the child table in turn to open the relationship dialog. Leave Identifying unchecked, choose PK as the source key, and map Source key → FK to the foreign key column you already created.

  1. Select the 1:N button in Relationship tools to turn the tool on.
  2. Click the parent table members, then the child table orders. The first click is the parent and the second is the child.
  3. In the dialog, leave Identifying unchecked. Non-identifying adds foreign keys without including them in the target primary key.
  4. Choose PK as the source key. The members primary key id becomes the referenced key.
  5. In Source key → FK, open the selector on the id row and pick the existing member_id instead of +Add column. Leaving +Add column selected creates a new id_2 column and changes the column count.
  6. Select Apply to save the relationship.
  7. Repeat: select the 1:N button again, click the parent orders and the child order_items, map the PK source key id to the existing order_id, then select Apply.
  • Both relationships allow zero or more (0..N). A member with no orders and an order with no items are both valid.
  • A foreign key whose type differs from the referenced column is reported as an error.
  • After both relationships the model still has three tables and ten columns. If a column appeared, you picked +Add column under Source key → FK.

7. Make every column required

Finish the model with columns that must hold a value. In Column details, turn Nullable off so the column cannot store an empty value.

  1. Select a column in Edit table.
  2. In Column details, turn Nullable off.
  3. Repeat for all ten columns across the three tables.
  • With Nullable on, the column can store an empty value.
  • Columns with Nullable off are exported as NOT NULL.

8. Save and reopen

Press Ctrl+S or Cmd+S to write the .drerd file into your workspace folder, then open the same file from the file list to see the saved model.

  1. Press Ctrl+S or Cmd+S.
  2. Confirm that the saved indicator replaces the unsaved one.
  3. Open first-erd again from the file list.
  4. Check that three tables, two relationships, and the required columns are unchanged.
  • Finished model: three tables, two non-identifying 0..N relationships, three primary keys, and two foreign keys.
  • The file you saved is a .drerd file in the workspace folder you chose.

9. Troubleshooting

Three situations come up most often while you work through this lesson.

  • Folder permission: choose Allow when the browser asks for access. If you denied it or the connection dropped, select Choose folder or Reconnect folder to pick the same folder again.
  • Relationship left unresolved: configure the relationship key and FK mapping. Set a primary key on the parent table first, then connect it.
  • Required column errors: check that Nullable is off for the columns you made required, and leave it on for columns that may be empty.

10. Next steps

Export the finished model and use it in a real database or in your documentation.

  • SQL export turns the model into PostgreSQL 18 DDL you can run on a database.
  • Mermaid export pastes cleanly into documentation and reviews.

Create your first ERD

After the app is prepared, Dr.ERD supports offline editing and local file saving.

Start editing

Dr.ERD 불러오는 중… / Loading Dr.ERD…