Skip to main content

Foreign Key Visualizer

See how your tables connect through foreign key relationships

SQL Schema

SQL35 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Relationship Map

6 Tables · 6 Foreign Keys

Foreign Key Chains

users.role_id→roles.id
users.department_id→departments.id
departments.parent_id→departments.id
orders.user_id→users.id ON DELETE CASCADE
orders.product_id→products.id
products.category_id→categories.id
📋 Mermaid Flowchart (copy to AI tools)
graph LR
  users -- role_id --> roles
  users -- department_id --> departments
  departments -- parent_id --> departments
  orders -- user_id|ON DELETE CASCADE| --> users
  orders -- product_id --> products
  products -- category_id --> categories

About the Foreign Key Visualizer

Visualize foreign key relationships in your SQL schema. See how tables connect and identify orphaned records.

Paste CREATE TABLE statements to generate a visual map of FK relationships. Exports as Mermaid for documentation.

How to use

  1. Paste your SQL schema.
  2. The relationship map renders automatically.
  3. Export as Mermaid or screenshot.