본문으로 건너뛰기
시각화

SQL to ER 다이어그램

CREATE TABLE 문을 파싱하여 Mermaid 형식의 ER 다이어그램을 자동으로 생성합니다. 기밀 유지되는 DB 설계를 브라우저 내에서 안전하게 시각화할 수 있습니다.

가이드: How to use & features

  • Enter or paste SQL `CREATE TABLE` statements into the text area.
  • Click the "Visualize" button to generate and display the ER diagram using Mermaid syntax.
  • Table relationships (Foreign Keys) are automatically extracted from `FOREIGN KEY` or `REFERENCES` clauses.
  • Use the "Copy Mermaid Code" button to save the generated syntax to your clipboard.
  • Your schema data is processed entirely in the browser, ensuring privacy and security.

샘플: Examples

Users and Posts (One-to-Many)

입력 예시

CREATE TABLE users (
  id INT PRIMARY KEY,
  name VARCHAR(50)
);

CREATE TABLE posts (
  id INT PRIMARY KEY,
  user_id INT REFERENCES users(id),
  title VARCHAR(100)
);

출력 예시

erDiagram
    users {
        INT id PK
        VARCHAR(50) name
    }
    posts {
        INT id PK
        INT user_id
        VARCHAR(100) title
    }

    posts }|--|| users : "user_id -> id"

FAQ: FAQ

  • Does it support all SQL dialects?

    It supports standard SQL CREATE TABLE syntax. Some highly specific proprietary vendor extensions may not be fully parsed as it uses a custom regex-based parser.
  • Is my data sent to a server?

    No. All processing is done locally in your browser via JavaScript. Your SQL code never leaves your computer.
  • What if relationships are not showing up?

    Ensure that your statements include FOREIGN KEY or REFERENCES clauses. The tool relies on these constraints to identify and draw relationships.

활용: Common Use Cases

  • Database Documentation

    Quickly visualize and document existing table structures by pasting SQL exports.

  • Schema Design Verification

    Self-check your DDL to ensure that relationships and constraints are correctly defined during the design phase.

  • Team Collaboration

    Share specific sub-system structures with your team using lightweight Mermaid syntax before generating full documentation.

주의: Notes & Limitations

  • Limited SQL Syntax

    Statements other than CREATE TABLE (e.g., stored procedures, triggers, complex INDEX definitions) are ignored.

  • Performance with Large Schemas

    Very large schemas with dozens of tables may significantly impact browser rendering performance.

  • Syntax Errors

    Incomplete or malformed SQL statements (missing parentheses, typos) will result in parsing failures.

erDiagram USERS ||--o{ POSTS : "user_id -> id" USERS { int id PK string name } POSTS { int id PK int user_id string title }

SQL에서 ER 다이어그램 생성

CREATE TABLE 같은 SQL 정의에서 테이블, 컬럼, 관계를 시각화한 ER 다이어그램을 생성합니다. 기존 schema를 이해하거나 데이터베이스 문서를 만들 때 유용합니다.

활용 예시

  • 레거시 schema 파악: SQL을 시각적 구조로 변환합니다.
  • DB 문서화: 리뷰나 가이드용 ER diagram을 만듭니다.
  • 관계 확인: key와 table 간 연결을 살펴봅니다.

SQL에 명시되지 않은 관계나 비즈니스 규칙은 자동으로 알 수 없으므로 수동 검토가 필요합니다.

이 도구의 관련 기사

Recent Articles

활용 사례
2026-08-04

CREATE TABLE 레퍼런스|MySQL·PostgreSQL·SQLite의 타입과 제약 조건 차이

CREATE TABLE(DDL) 작성법을 3개 데이터베이스 비교표로 정리했습니다. 타입 대응표, 자동 증가(AUTO_INCREMENT / IDENTITY / rowid)의 방언 차이, 외래 키의 ON DELETE 동작, MySQL이 조용히 무시하는 CHECK 제약까지 예제와 함께 해설합니다.

도구 소개
2026-08-03

테이블 설계에서 CREATE TABLE 문을 자동 생성하는 구조 | DDL 빌더

테이블을 시각적으로 설계해 CREATE TABLE 문과 ER 다이어그램을 생성하는 DDL 빌더의 구현을 해설합니다. MySQL/PostgreSQL/SQLite의 타입 변환 규칙과 JSON 샘플에서 컬럼을 추론하는 알고리즘을 예제와 함께 정리했습니다.

활용 사례
2026-07-21

GitHub Actions needs 설계 패턴집|CI를 빠르게 만드는 의존관계 구성과 안티패턴

GitHub Actions의 needs로 만드는 job 의존관계를, 고속화 패턴과 안티패턴 표로 정리합니다. concurrency를 이용한 중복 실행 취소, fail-fast, matrix×needs 조합, 재사용 가능한 워크플로우까지 실전 예제로 해설합니다.

활용 사례
2026-07-21

Mermaid ER 다이어그램 문법 레퍼런스|관계 기호와 실전 예제

Mermaid erDiagram 문법 완전 정리: 까마귀발 표기법 카디널리티 치트시트, 1대다 vs 다대다, PK/FK를 포함한 속성 정의, 전자상거래 완전 예제까지 다룹니다.

도구 소개
2026-07-21

SQL 빌더로 SELECT·JOIN 쿼리를 시각적으로 작성하는 방법

브라우저에서 시각적 SQL 빌더로 SELECT, WHERE, JOIN을 조립하는 방법을 해설합니다. 값의 자동 따옴표 판정 원리, JOIN 사용 구분표, 여러 테이블 JOIN 작성법까지 다룹니다.

활용 사례
2026-07-21

SQL JOIN 완전 레퍼런스|INNER·LEFT·RIGHT·FULL의 차이와 결과 행 수 이해하기

SQL JOIN 종류(INNER/LEFT/RIGHT/FULL/CROSS/SELF)를 치트시트와 결과 행 수 예제로 정리합니다. 1대다 JOIN에서 행이 늘어나는 이유, WHERE절과 ON절의 NULL 처리 차이, 여러 테이블 JOIN 작성법까지 다룹니다.

광고

광고