[{"data":1,"prerenderedAt":597},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fdatabase-explorer\u002Fdatabase-diagrams":3},{"id":4,"title":5,"body":6,"description":588,"extension":589,"meta":590,"navigation":591,"path":592,"redirect":593,"seo":594,"stem":595,"__hash__":596},"docs\u002Fdocs\u002Fdatabase-explorer\u002Fdatabase-diagrams.md","Database Diagrams",{"type":7,"value":8,"toc":559},"minimark",[9,13,17,22,25,38,44,48,56,78,81,85,90,116,120,140,144,147,167,171,174,178,182,208,212,240,244,258,262,268,275,279,308,312,315,335,376,380,383,403,408,427,431,435,438,449,453,456,471,474,478,532,536],[10,11,5],"h1",{"id":12},"database-diagrams",[14,15,16],"p",{},"The interactive database diagram provides a visual representation of your database schema, making it easy to understand table relationships and explore your data structure.",[18,19,21],"h2",{"id":20},"video-walkthrough","Video Walkthrough",[14,23,24],{},"For a video walkthrough of the diagram viewer, watch the following video:",[14,26,27],{},[28,29,33],"a",{"href":30,"rel":31},"https:\u002F\u002Fyoutu.be\u002FCwmqJ9SLDzU?si=IT_gQ9hzQOXivxZZ",[32],"nofollow",[34,35],"img",{"alt":36,"src":37},"Database Diagram Viewer Walkthrough","https:\u002F\u002Fimg.youtube.com\u002Fvi\u002FCwmqJ9SLDzU\u002F0.jpg",[14,39,40],{},[28,41,43],{"href":30,"rel":42},[32],"Watch on YouTube",[18,45,47],{"id":46},"opening-a-diagram","Opening a diagram",[14,49,50,51,55],{},"Right-click in the Explorer sidebar and select ",[52,53,54],"strong",{},"Show diagram",":",[57,58,59,66,72],"ul",{},[60,61,62,65],"li",{},[52,63,64],{},"On a database"," — opens a full diagram of all tables and views in that database",[60,67,68,71],{},[52,69,70],{},"On a table"," — opens the diagram and focuses on that table",[60,73,74,77],{},[52,75,76],{},"On a view"," — opens the diagram and focuses on that view",[14,79,80],{},"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.",[18,82,84],{"id":83},"diagram-elements","Diagram elements",[86,87,89],"h3",{"id":88},"tables-and-views","Tables and views",[57,91,92,98,104,110],{},[60,93,94,97],{},[52,95,96],{},"Tables"," — solid-bordered boxes displaying table name and columns",[60,99,100,103],{},[52,101,102],{},"Views"," — dashed border and italic label to distinguish them from tables",[60,105,106,109],{},[52,107,108],{},"Primary keys"," — key icon, highlighted in teal blue",[60,111,112,115],{},[52,113,114],{},"Foreign keys"," — link icon, highlighted in orange",[86,117,119],{"id":118},"relationship-lines","Relationship lines",[57,121,122,128,134],{},[60,123,124,127],{},[52,125,126],{},"Teal blue solid lines"," — foreign key relationships between tables",[60,129,130,133],{},[52,131,132],{},"Orange solid lines"," — relationships through junction tables (many-to-many)",[60,135,136,139],{},[52,137,138],{},"Gray dashed lines"," — view dependencies (views referencing base tables)",[86,141,143],{"id":142},"relationship-markers","Relationship markers",[14,145,146],{},"The diagram uses crow's foot notation at the ends of relationship lines:",[57,148,149,155,161],{},[60,150,151,154],{},[52,152,153],{},"Crow's foot"," — the \"many\" side of a relationship (branching lines)",[60,156,157,160],{},[52,158,159],{},"Vertical bar"," — the \"one\" side of a relationship",[60,162,163,166],{},[52,164,165],{},"Double vertical bar"," — the \"one\" side with a mandatory constraint",[86,168,170],{"id":169},"legend","Legend",[14,172,173],{},"The legend panel in the top-left corner shows all visual conventions: table, view, foreign key, junction table, and view dependency line styles.",[18,175,177],{"id":176},"interacting-with-the-diagram","Interacting with the diagram",[86,179,181],{"id":180},"navigation","Navigation",[57,183,184,190,196,202],{},[60,185,186,189],{},[52,187,188],{},"Pan"," — click and drag on empty space to move around",[60,191,192,195],{},[52,193,194],{},"Zoom"," — mouse wheel or trackpad scroll to zoom in\u002Fout",[60,197,198,201],{},[52,199,200],{},"Drag tables"," — click and drag any table to reposition it; the table stays pinned at the new position",[60,203,204,207],{},[52,205,206],{},"Double-click a table"," — unpins it, allowing the force layout to reposition it automatically",[86,209,211],{"id":210},"selecting-and-highlighting","Selecting and highlighting",[57,213,214,234],{},[60,215,216,219,220],{},[52,217,218],{},"Click a table"," — selects it and highlights its relationships:\n",[57,221,222,225,228,231],{},[60,223,224],{},"The selected table gets a blue border",[60,226,227],{},"Directly related tables get an orange border",[60,229,230],{},"Related foreign key and primary key fields are highlighted",[60,232,233],{},"Unrelated tables and lines dim to low opacity",[60,235,236,239],{},[52,237,238],{},"Click empty space"," — deselects all tables and restores full opacity",[86,241,243],{"id":242},"hover-information","Hover information",[57,245,246,252],{},[60,247,248,251],{},[52,249,250],{},"Hover a field"," — shows relationship details for highlighted fields",[60,253,254,257],{},[52,255,256],{},"Hover a relationship line"," — shows details about the relationship",[18,259,261],{"id":260},"controls-panel","Controls panel",[263,264],"themed-image",{"alt":265,"dark":266,"light":267},"Database Diagram","\u002Fimages\u002Fpages\u002Fer-diagram-tool\u002Fdiagram-dark.png","\u002Fimages\u002Fpages\u002Fer-diagram-tool\u002Fdiagram-light.png",[14,269,270,271,274],{},"The ",[52,272,273],{},"Diagram Tools"," panel floats in the top-right corner. It is draggable (grab the grip icon in the header) and collapsible.",[86,276,278],{"id":277},"zoom-controls","Zoom controls",[57,280,281,296,302],{},[60,282,283,289,290,295],{},[52,284,285],{},[286,287,288],"code",{},"−"," \u002F ",[52,291,292],{},[286,293,294],{},"+"," buttons — zoom out \u002F zoom in",[60,297,298,301],{},[52,299,300],{},"Percentage display"," — shows current zoom level (range: 20%–300%)",[60,303,304,307],{},[52,305,306],{},"Auto layout"," (sparkles icon) — recalculates the force layout and re-centers the diagram",[86,309,311],{"id":310},"export","Export",[14,313,314],{},"Click the download icon to open the export options:",[316,317,318,332],"ol",{},[60,319,320,321,324,325,328,329],{},"Select a format: ",[52,322,323],{},"SVG",", ",[52,326,327],{},"PNG",", or ",[52,330,331],{},"PDF",[60,333,334],{},"Click the download button",[336,337,338,351],"table",{},[339,340,341],"thead",{},[342,343,344,348],"tr",{},[345,346,347],"th",{},"Format",[345,349,350],{},"Best for",[352,353,354,362,369],"tbody",{},[342,355,356,359],{},[357,358,323],"td",{},[357,360,361],{},"Web use, scaling without quality loss",[342,363,364,366],{},[357,365,327],{},[357,367,368],{},"Presentations, embedding in documents",[342,370,371,373],{},[357,372,331],{},[357,374,375],{},"Printing and formal documentation",[86,377,379],{"id":378},"force-layout-controls","Force layout controls",[14,381,382],{},"The diagram uses a force-directed layout. Three sliders let you tune it:",[57,384,385,391,397],{},[60,386,387,390],{},[52,388,389],{},"Link Distance"," (100–800px) — preferred length of connections between tables",[60,392,393,396],{},[52,394,395],{},"Charge Strength"," (−6000 to −200) — how strongly tables repel each other; more negative = more spread out",[60,398,399,402],{},[52,400,401],{},"Collision Radius"," (60–320px) — minimum spacing between tables to prevent overlap",[14,404,405],{},[52,406,407],{},"Suggested tuning order:",[316,409,410,416,422],{},[60,411,412,413,415],{},"Set ",[52,414,401],{}," to eliminate overlap",[60,417,418,419,421],{},"Adjust ",[52,420,389],{}," for readability",[60,423,418,424,426],{},[52,425,395],{}," to reduce clumping or tighten the layout",[18,428,430],{"id":429},"understanding-relationships","Understanding relationships",[86,432,434],{"id":433},"one-to-many","One-to-many",[14,436,437],{},"The most common type. One record in the first table can be referenced by multiple records in the second table.",[14,439,440,441,444,445,448],{},"Example: one ",[286,442,443],{},"customer"," can have many ",[286,446,447],{},"rental"," records.",[86,450,452],{"id":451},"many-to-many","Many-to-many",[14,454,455],{},"Both tables can reference multiple records in each other, connected through a junction table.",[14,457,458,459,462,463,466,467,470],{},"Example: many ",[286,460,461],{},"film"," records can have many ",[286,464,465],{},"actor"," records through the ",[286,468,469],{},"film_actor"," junction table. Orange lines indicate these relationships.",[14,472,473],{},"Junction tables are identified by having exactly two foreign keys that form a composite primary key.",[18,475,477],{"id":476},"troubleshooting","Troubleshooting",[336,479,480,490],{},[339,481,482],{},[342,483,484,487],{},[345,485,486],{},"Issue",[345,488,489],{},"Solution",[352,491,492,500,508,516,524],{},[342,493,494,497],{},[357,495,496],{},"Tables overlap",[357,498,499],{},"Increase Collision Radius",[342,501,502,505],{},[357,503,504],{},"Diagram is too cluttered",[357,506,507],{},"Increase Link Distance and Charge Strength (more negative)",[342,509,510,513],{},[357,511,512],{},"Tables are too spread out",[357,514,515],{},"Decrease Link Distance and Charge Strength (less negative)",[342,517,518,521],{},[357,519,520],{},"A dragged table won't move back",[357,522,523],{},"Double-click it to unpin, or click Auto layout",[342,525,526,529],{},[357,527,528],{},"Can't see the whole diagram",[357,530,531],{},"Click Auto layout to re-center, or zoom out",[18,533,535],{"id":534},"related-docs","Related docs",[57,537,538,545,552],{},[60,539,540,544],{},[28,541,543],{"href":542},".\u002Ftables-views","Navigator and Object Browsing"," — Connection tree, database overview",[60,546,547,551],{},[28,548,550],{"href":549},".\u002Ftable-structure","Examining Table Structure"," — Columns, keys, indexes, DDL",[60,553,554,558],{},[28,555,557],{"href":556},".\u002Fsql-console","SQL Console"," — Direct and file-aware SQL",{"title":560,"searchDepth":561,"depth":561,"links":562},"",2,[563,564,565,572,577,582,586,587],{"id":20,"depth":561,"text":21},{"id":46,"depth":561,"text":47},{"id":83,"depth":561,"text":84,"children":566},[567,569,570,571],{"id":88,"depth":568,"text":89},3,{"id":118,"depth":568,"text":119},{"id":142,"depth":568,"text":143},{"id":169,"depth":568,"text":170},{"id":176,"depth":561,"text":177,"children":573},[574,575,576],{"id":180,"depth":568,"text":181},{"id":210,"depth":568,"text":211},{"id":242,"depth":568,"text":243},{"id":260,"depth":561,"text":261,"children":578},[579,580,581],{"id":277,"depth":568,"text":278},{"id":310,"depth":568,"text":311},{"id":378,"depth":568,"text":379},{"id":429,"depth":561,"text":430,"children":583},[584,585],{"id":433,"depth":568,"text":434},{"id":451,"depth":568,"text":452},{"id":476,"depth":561,"text":477},{"id":534,"depth":561,"text":535},"Learn how to view database relationship diagrams in Database Explorer","md",{},false,"\u002Fdocs\u002Fdatabase-explorer\u002Fdatabase-diagrams",null,{"title":5,"description":588},"docs\u002Fdatabase-explorer\u002Fdatabase-diagrams","kvL1vNv6kPQAY60xy_Zu-dgRSK0J8GXoH-vVxCJbH4g",1782346473899]