Database Diagrams
The interactive database diagram provides a visual representation of your database schema, making it easy to understand table relationships and explore your data structure.
Video Walkthrough
For a video walkthrough of the diagram viewer, watch the following video:
Opening a diagram
Right-click in the Explorer sidebar and select Show diagram:
- On a database — opens a full diagram of all tables and views in that database
- On a table — opens the diagram and focuses on that table
- On a view — opens the diagram and focuses on that view
The diagram opens in a dedicated tab. If a diagram tab for the same database is already open, it is reused and the focus shifts to the selected table.
Diagram elements
Tables and views
- Tables — solid-bordered boxes displaying table name and columns
- Views — dashed border and italic label to distinguish them from tables
- Primary keys — key icon, highlighted in teal blue
- Foreign keys — link icon, highlighted in orange
Relationship lines
- Teal blue solid lines — foreign key relationships between tables
- Orange solid lines — relationships through junction tables (many-to-many)
- Gray dashed lines — view dependencies (views referencing base tables)
Relationship markers
The diagram uses crow's foot notation at the ends of relationship lines:
- Crow's foot — the "many" side of a relationship (branching lines)
- Vertical bar — the "one" side of a relationship
- Double vertical bar — the "one" side with a mandatory constraint
Legend
The legend panel in the top-left corner shows all visual conventions: table, view, foreign key, junction table, and view dependency line styles.
Interacting with the diagram
Navigation
- Pan — click and drag on empty space to move around
- Zoom — mouse wheel or trackpad scroll to zoom in/out
- Drag tables — click and drag any table to reposition it; the table stays pinned at the new position
- Double-click a table — unpins it, allowing the force layout to reposition it automatically
Selecting and highlighting
- Click a table — selects it and highlights its relationships:
- The selected table gets a blue border
- Directly related tables get an orange border
- Related foreign key and primary key fields are highlighted
- Unrelated tables and lines dim to low opacity
- Click empty space — deselects all tables and restores full opacity
Hover information
- Hover a field — shows relationship details for highlighted fields
- Hover a relationship line — shows details about the relationship
Controls panel
The Diagram Tools panel floats in the top-right corner. It is draggable (grab the grip icon in the header) and collapsible.
Zoom controls
−/+buttons — zoom out / zoom in- Percentage display — shows current zoom level (range: 20%–300%)
- Auto layout (sparkles icon) — recalculates the force layout and re-centers the diagram
Export
Click the download icon to open the export options:
- Select a format: SVG, PNG, or PDF
- Click the download button
| Format | Best for |
|---|---|
| SVG | Web use, scaling without quality loss |
| PNG | Presentations, embedding in documents |
| Printing and formal documentation |
Force layout controls
The diagram uses a force-directed layout. Three sliders let you tune it:
- Link Distance (100–800px) — preferred length of connections between tables
- Charge Strength (−6000 to −200) — how strongly tables repel each other; more negative = more spread out
- Collision Radius (60–320px) — minimum spacing between tables to prevent overlap
Suggested tuning order:
- Set Collision Radius to eliminate overlap
- Adjust Link Distance for readability
- Adjust Charge Strength to reduce clumping or tighten the layout
Understanding relationships
One-to-many
The most common type. One record in the first table can be referenced by multiple records in the second table.
Example: one customer can have many rental records.
Many-to-many
Both tables can reference multiple records in each other, connected through a junction table.
Example: many film records can have many actor records through the film_actor junction table. Orange lines indicate these relationships.
Junction tables are identified by having exactly two foreign keys that form a composite primary key.
Troubleshooting
| Issue | Solution |
|---|---|
| Tables overlap | Increase Collision Radius |
| Diagram is too cluttered | Increase Link Distance and Charge Strength (more negative) |
| Tables are too spread out | Decrease Link Distance and Charge Strength (less negative) |
| A dragged table won't move back | Double-click it to unpin, or click Auto layout |
| Can't see the whole diagram | Click Auto layout to re-center, or zoom out |
Related docs
- Navigator and Object Browsing — Connection tree, database overview
- Examining Table Structure — Columns, keys, indexes, DDL
- SQL Console — Direct and file-aware SQL
