{"id":85,"date":"2026-05-26T07:38:24","date_gmt":"2026-05-26T07:38:24","guid":{"rendered":"https:\/\/www.vpascode.com\/id\/docs\/uncategorized\/plantuml-playbook\/plantuml-erd-syntax-guide\/"},"modified":"2026-07-29T08:30:40","modified_gmt":"2026-07-29T08:30:40","slug":"plantuml-erd-syntax-guide","status":"publish","type":"ld_docs","link":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/","title":{"rendered":"PlantUML ERD Syntax Guide"},"content":{"rendered":"<h2>What is an Entity Relationship Diagram (ERD)?<\/h2>\n<p>An <strong>Entity Relationship Diagram (ERD)<\/strong> is a structural blueprint used to design, document, and analyze relational databases. It visualizes the tables (entities) within a system, the specific columns (attributes) they contain, and how those tables link together. In PlantUML, ERDs are authored using the <strong>Information Engineering (IE) notation<\/strong>, which implements standard <strong>crow&#8217;s foot notation<\/strong> to represent relational constraints.<\/p>\n<p>Whether you are designing a microservice data store, optimizing SQL join paths, or mapping out an enterprise-wide data warehouse architecture, a text-driven UML ERD ensures your database schemas are perfectly clear. With <strong>VPasCode<\/strong>, you can define your database tables, index keys, and logical relationships using a clean, declarative syntax. The engine automatically handles table box sizing and routes your foreign key connector strings without any overlapping layout lines.<\/p>\n<h2>Core Syntax Guide: Elements and Constructs<\/h2>\n<p>Building a robust IE-style ERD in PlantUML relies on structured entity blocks, explicit key designations, and crow&#8217;s foot cardinality modifiers.<\/p>\n<h3>1. Declaring Entities (Database Tables)<\/h3>\n<p>You declare a database table using the <code>entity<\/code> keyword, followed by the table name and a set of curly braces. Inside the braces, you list your table columns. To make your schema clean and readable, use a horizontal line separator (<code>--<\/code>) to separate your primary\/foreign keys from standard data attributes:<\/p>\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Plantuml<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:IyqhoIofL50gBKujAbPII2nM0BFYInAJSb8Lgdcv580WCqN1Ii7JBqGXEi0x5YAagmkXKtCJCtE0ic6EGSuUZa4QHgQccX2PvABKn9BKbFZ44g1qYAUlQt28esy0BrSj0000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-plantuml\"><code data-language=\"plantuml\" class=\"language-plantuml\">entity \"users\" as users_table {\r\n    id : INT [PK]\r\n    --\r\n    email : VARCHAR(255)\r\n    created_at : TIMESTAMP\r\n}<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:IyqhoIofL50gBKujAbPII2nM0BFYInAJSb8Lgdcv580WCqN1Ii7JBqGXEi0x5YAagmkXKtCJCtE0ic6EGSuUZa4QHgQccX2PvABKn9BKbFZ44g1qYAUlQt28esy0BrSj0000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<p id=\"jsXYoEv\"><img decoding=\"async\" width=\"183\" height=\"98\" class=\"alignnone size-full wp-image-598 \" src=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png\" alt=\"\" \/><\/p>\n<h3>2. Designating Primary and Foreign Keys<\/h3>\n<p>While text indicators like `[PK]` or `[FK]` work well, PlantUML&#8217;s IE engine also supports visual key icons. Placing an asterisk (<code>*<\/code>) before an attribute designates it as a **mandatory (not null)** column, while a clean text string or tag adds explicit indexing context:<\/p>\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Plantuml<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:IyqhoIofL53ABqf9BIfMKgZcvL800Ys5p1G5AmLFln056vi0RpixYB2kBaowj3YrA1v9ZHjSJKfcSN9-QLv9V79-IYfGFimnoDd3CKZ3r42JbwiM0000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-plantuml\"><code data-language=\"plantuml\" class=\"language-plantuml\">entity \"orders\" {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * user_id : INT &lt;&lt;FK&gt;&gt;\r\n    discount_code : VARCHAR(50)\r\n}<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:IyqhoIofL53ABqf9BIfMKgZcvL800Ys5p1G5AmLFln056vi0RpixYB2kBaowj3YrA1v9ZHjSJKfcSN9-QLv9V79-IYfGFimnoDd3CKZ3r42JbwiM0000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<p id=\"aivVLsO\"><img decoding=\"async\" width=\"239\" height=\"98\" class=\"alignnone size-full wp-image-599 \" src=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19010e1b143.png\" alt=\"\" \/><\/p>\n<h3>3. Mapping Crow&#8217;s Foot Cardinality and Relationships<\/h3>\n<p>To connect tables and enforce referential integrity constraints, use a combination of dashes, brackets, and pipe characters. In IE notation, these symbols form distinct **crow&#8217;s foot** heads that represent database relationships:<\/p>\n<ul>\n<li><code>||--||<\/code> **Exactly One to Exactly One:** A strict, mandatory one-to-one mapping.<\/li>\n<li><code>||--o|<\/code> **Exactly One to Zero or One:** An optional one-to-one mapping.<\/li>\n<li><code>||--|{<\/code> **Exactly One to One or Many:** A mandatory one-to-many dependency.<\/li>\n<li><code>||--o{<\/code> **Exactly One to Zero, One, or Many:** A standard, optional one-to-many relationship.<\/li>\n<\/ul>\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Plantuml<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:AorEBIgEBqbCoabLgAdHrSslLiWlIW6AALWfA1Na92Qd5Yi10000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-plantuml\"><code data-language=\"plantuml\" class=\"language-plantuml\">users_table ||--o{ orders : \"places\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:AorEBIgEBqbCoabLgAdHrSslLiWlIW6AALWfA1Na92Qd5Yi10000\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<p id=\"BYtNcjJ\"><img decoding=\"async\" width=\"114\" height=\"174\" class=\"alignnone size-full wp-image-600 \" src=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a190119b741e.png\" alt=\"\" \/><\/p>\n<h2>Best Practices for Clean Database Schemas<\/h2>\n<ul>\n<li><strong>Maintain Casing Conventions:<\/strong> Keep your entity declarations predictable. Use lowercase snake_case (e.g., <code>order_items<\/code>) for actual SQL-mapped tables, or use uppercase CamelCase for conceptual domain models.<\/li>\n<li><strong>Always Document Foreign Keys:<\/strong> When linking two tables, always specify the foreign key column inside the child table block. This provides clear reference contexts for engineering teams during data migrations.<\/li>\n<li><strong>Control Crow&#8217;s Foot Spacing:<\/strong> Complex database schemas with dozens of tables can quickly become crowded. If your relationship lines begin to cross unnaturally, replace your double-dash connectors (<code>--<\/code>) with three or four dashes (<code>---<\/code>) to push the tables apart and allow the layout engine more room to organize the grid.<\/li>\n<\/ul>\n<h2>Real-World PlantUML ERD Examples<\/h2>\n<h3>Example 1: Core Core E-Commerce Relational Model (Keys &amp; Mappings)<\/h3>\n<p>This functional blueprint models a core e-commerce database transaction loop, showing how users, orders, and payment ledgers link together using strict crow&#8217;s foot relationships.<\/p>\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Plantuml<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:ZP9DQy9048RlWVo7mOkjD605BoAY-46bLaIaq5COap5PckocknkirVxtJZGfWLfmJyEyx-u-yp4q5hNDqyHrcZ3JH5y49Asm1zYgJz0aGz92HY2aLM1Yr1caYdCIp4UEcephn28a28GE4d8TyovaXXfJMCoNqytRQWfAsrYvZkkK3pToGzeq00qK4HnT1_YqG8JGW_bo0_t-wdamkAGzhv8fHP6mutMq7Z-DrdUFxVPzfMLep5xfq8_Hn3LFfzijFLci9DMLul9t7OklLrpdy6QmeWg_vfdzUbfWbSN4nrJbqh9XCXtFNqOBPd_eb60y0PkR6bdt3rc6XvHZFw4mgX0lySsCvuh-XTGe3GPMAEbhsX6FFQ2hdOxGqXuFLscRCA6Tu2PhIh1u2nCmGSnZWwsG8MyHByjvugUJvwbZsUKUrvTWGARXEfTC8PzELOMiHoH9yy-5PSWhoVlw0m00\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-plantuml\"><code data-language=\"plantuml\" class=\"language-plantuml\">@startuml\r\n' Freeze entity box rendering into sharp modern squares\r\nhide circle\r\nskinparam LINETYPE ortho\r\n\r\nentity \"users\" as user {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * email : VARCHAR(100)\r\n    * password_hash : VARCHAR(255)\r\n    phone : VARCHAR(20)\r\n}\r\n\r\nentity \"orders\" as order {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * user_id : INT &lt;&lt;FK&gt;&gt;\r\n    * total_amount : DECIMAL(10,2)\r\n    status : VARCHAR(50)\r\n}\r\n\r\nentity \"payment_ledgers\" as ledger {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * order_id : INT &lt;&lt;FK&gt;&gt;\r\n    * transaction_reference : VARCHAR(100)\r\n    gateway : VARCHAR(50)\r\n}\r\n\r\n' Define relational schema bindings\r\nuser ||--o{ order : \"places\"\r\norder ||--|| ledger : \"generates\"\r\n@enduml<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:ZP9DQy9048RlWVo7mOkjD605BoAY-46bLaIaq5COap5PckocknkirVxtJZGfWLfmJyEyx-u-yp4q5hNDqyHrcZ3JH5y49Asm1zYgJz0aGz92HY2aLM1Yr1caYdCIp4UEcephn28a28GE4d8TyovaXXfJMCoNqytRQWfAsrYvZkkK3pToGzeq00qK4HnT1_YqG8JGW_bo0_t-wdamkAGzhv8fHP6mutMq7Z-DrdUFxVPzfMLep5xfq8_Hn3LFfzijFLci9DMLul9t7OklLrpdy6QmeWg_vfdzUbfWbSN4nrJbqh9XCXtFNqOBPd_eb60y0PkR6bdt3rc6XvHZFw4mgX0lySsCvuh-XTGe3GPMAEbhsX6FFQ2hdOxGqXuFLscRCA6Tu2PhIh1u2nCmGSnZWwsG8MyHByjvugUJvwbZsUKUrvTWGARXEfTC8PzELOMiHoH9yy-5PSWhoVlw0m00\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<p id=\"UBJPtUm\"><img loading=\"lazy\" decoding=\"async\" width=\"301\" height=\"444\" class=\"alignnone size-full wp-image-601 \" src=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19012676e1c.png\" alt=\"\" srcset=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19012676e1c.png 301w, https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19012676e1c-203x300.png 203w\" sizes=\"(max-width: 301px) 100vw, 301px\" \/><\/p>\n<p><strong>Syntax Breakdown:<\/strong> The directive <code>hide circle<\/code> disables the default UML class token bubbles, while <code>skinparam LINETYPE ortho<\/code> forces relationship paths into clean 90-degree right angles. The schema clearly shows that a user can place zero or many orders (<code>||--o{<\/code>), while an order must have exactly one associated payment ledger record (<code>||--||<\/code>).<\/p>\n<h3>Example 2: Advanced Content Management System Schema (Many-to-Many Intersection)<\/h3>\n<p>This advanced enterprise blueprint maps a complete content management system (CMS) topology. It showcases how to handle many-to-many architectures cleanly by leveraging an intermediate mapping table.<\/p>\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Plantuml<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:ZPFVQy8m4CVV0_aV3b-s2GKty4L4bD4nsHHnPMnF9Mj36soJabmVdFg_BxK_h9qRzYcN-tBtkU-bKuDCOvucbCGYv1087IIS4hCHCcEQfV0wNxhUvye5fJ5Mb5329GhSGYzJ1aqFc87Y13jAm7vz426COBxqO3nUlKmcvRNZr6cMsphQRwcU6bKVREc4sypxRFtuF5lVFWo7TsNE97bqCV6bmgrDUEw7HycXJHWmv97IWfUOLRYz6bMojCroFnXKBKDk0Yqo54h-GZfqFVBhldxAiap8gAIfWXFCKTiXEZUdAVIFggPdneX8yj1dM9WpNxXltconwZgaqjIUAt_Au6fxki0dY6h7V_fdHr4IYrvdUxk1DKzOuIfB815o0mPr7c2kkQ7a-ChsUyTHkyQyKJ62H2QawL7IBFY2gdeAtxmGjalLKriHGsH1V5HCkGpjR_43\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-plantuml\"><code data-language=\"plantuml\" class=\"language-plantuml\">@startuml\r\nhide circle\r\nskinparam LINETYPE ortho\r\n\r\nentity \"posts\" as post {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * author_id : INT &lt;&lt;FK&gt;&gt;\r\n    * title : VARCHAR(255)\r\n    slug : VARCHAR(255)\r\n    body : TEXT\r\n}\r\n\r\nentity \"categories\" as category {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * name : VARCHAR(100)\r\n    description : VARCHAR(255)\r\n}\r\n\r\nentity \"post_category_mappings\" as mapping {\r\n    * post_id : INT &lt;&lt;PK&gt;&gt;&lt;&lt;FK&gt;&gt;\r\n    * category_id : INT &lt;&lt;PK&gt;&gt;&lt;&lt;FK&gt;&gt;\r\n    --\r\n    assigned_at : TIMESTAMP\r\n}\r\n\r\nentity \"comments\" as comment {\r\n    * id : INT &lt;&lt;PK&gt;&gt;\r\n    --\r\n    * post_id : INT &lt;&lt;FK&gt;&gt;\r\n    author_name : VARCHAR(100)\r\n    * content : TEXT\r\n}\r\n\r\n' Relational link structures\r\npost ||--o{ mapping : \"contains\"\r\ncategory ||--o{ mapping : \"categorizes\"\r\npost ||--o{ comment : \"attaches\"\r\n@enduml<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/#plantuml:ZPFVQy8m4CVV0_aV3b-s2GKty4L4bD4nsHHnPMnF9Mj36soJabmVdFg_BxK_h9qRzYcN-tBtkU-bKuDCOvucbCGYv1087IIS4hCHCcEQfV0wNxhUvye5fJ5Mb5329GhSGYzJ1aqFc87Y13jAm7vz426COBxqO3nUlKmcvRNZr6cMsphQRwcU6bKVREc4sypxRFtuF5lVFWo7TsNE97bqCV6bmgrDUEw7HycXJHWmv97IWfUOLRYz6bMojCroFnXKBKDk0Yqo54h-GZfqFVBhldxAiap8gAIfWXFCKTiXEZUdAVIFggPdneX8yj1dM9WpNxXltconwZgaqjIUAt_Au6fxki0dY6h7V_fdHr4IYrvdUxk1DKzOuIfB815o0mPr7c2kkQ7a-ChsUyTHkyQyKJ62H2QawL7IBFY2gdeAtxmGjalLKriHGsH1V5HCkGpjR_43\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Plantuml in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<p id=\"uRrOAMH\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"293\" class=\"alignnone size-full wp-image-602 \" src=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19013a7b57a.png\" alt=\"\" srcset=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19013a7b57a.png 495w, https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a19013a7b57a-300x178.png 300w\" sizes=\"(max-width: 495px) 100vw, 495px\" \/><\/p>\n<p><strong>Syntax Breakdown:<\/strong> This template models a classic many-to-many relationship between posts and categories. Rather than connecting them directly, it introduces an intermediate table (<code>post_category_mappings<\/code>) where both columns serve as a composite primary key. The crow&#8217;s foot indicators explicitly map the cascading relationships down to the comments layer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is an Entity Relationship Diagram (ERD)? An Entity Relationship Diagram (ERD) is a structural blueprint used to design, document, and analyze relational databases. It visualizes the tables (entities) within a system, the specific columns (attributes) they contain, and how&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":47,"menu_order":10,"template":"","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"ld_collection":[14],"class_list":["post-85","ld_docs","type-ld_docs","status-publish","hentry","ld_collection-vpascode-docs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide<\/title>\n<meta name=\"description\" content=\"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide\" \/>\n<meta property=\"og:description\" content=\"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"VPasCode\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-29T08:30:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/\",\"name\":\"PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2026\\\/05\\\/img_6a1901022bcfe.png\",\"datePublished\":\"2026-05-26T07:38:24+00:00\",\"dateModified\":\"2026-07-29T08:30:40+00:00\",\"description\":\"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2026\\\/05\\\/img_6a1901022bcfe.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2026\\\/05\\\/img_6a1901022bcfe.png\",\"width\":183,\"height\":98},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/plantuml-erd-syntax-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lean Docs\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/%ld_collection%\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PlantUML Playbook\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/docs\\\/vpascode-docs\\\/plantuml-playbook\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"PlantUML ERD Syntax Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#website\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/\",\"name\":\"VPasCode\",\"description\":\"by Visual Paradigm\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#organization\",\"name\":\"VPasCode\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"width\":128,\"height\":138,\"caption\":\"VPasCode\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/id\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide","description":"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/","og_locale":"id_ID","og_type":"article","og_title":"PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide","og_description":"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.","og_url":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/","og_site_name":"VPasCode","article_modified_time":"2026-07-29T08:30:40+00:00","og_image":[{"url":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Estimasi waktu membaca":"4 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/","url":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/","name":"PlantUML ERD Diagram Syntax | VPasCode Text to Diagram Guide","isPartOf":{"@id":"https:\/\/www.vpascode.com\/id\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png","datePublished":"2026-05-26T07:38:24+00:00","dateModified":"2026-07-29T08:30:40+00:00","description":"Design relational database schemas with PlantUML entity relationship diagrams in VPasCode, a free diagram-as-code tool.","breadcrumb":{"@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/"]}]},{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/#primaryimage","url":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png","contentUrl":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/05\/img_6a1901022bcfe.png","width":183,"height":98},{"@type":"BreadcrumbList","@id":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/plantuml-erd-syntax-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vpascode.com\/id\/"},{"@type":"ListItem","position":2,"name":"Lean Docs","item":"https:\/\/www.vpascode.com\/id\/docs\/%ld_collection%\/"},{"@type":"ListItem","position":3,"name":"PlantUML Playbook","item":"https:\/\/www.vpascode.com\/id\/docs\/vpascode-docs\/plantuml-playbook\/"},{"@type":"ListItem","position":4,"name":"PlantUML ERD Syntax Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.vpascode.com\/id\/#website","url":"https:\/\/www.vpascode.com\/id\/","name":"VPasCode","description":"by Visual Paradigm","publisher":{"@id":"https:\/\/www.vpascode.com\/id\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vpascode.com\/id\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Organization","@id":"https:\/\/www.vpascode.com\/id\/#organization","name":"VPasCode","url":"https:\/\/www.vpascode.com\/id\/","logo":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/www.vpascode.com\/id\/#\/schema\/logo\/image\/","url":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/06\/cropped-vp-online-logo-v1.png","contentUrl":"https:\/\/www.vpascode.com\/id\/wp-content\/uploads\/sites\/7\/2026\/06\/cropped-vp-online-logo-v1.png","width":128,"height":138,"caption":"VPasCode"},"image":{"@id":"https:\/\/www.vpascode.com\/id\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/ld_docs\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/ld_docs"}],"about":[{"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/types\/ld_docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/users\/4"}],"up":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/ld_docs\/47"}],"wp:attachment":[{"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"ld_collection","embeddable":true,"href":"https:\/\/www.vpascode.com\/id\/wp-json\/wp\/v2\/ld_collection?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}