[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-656097-105":59,"doc-detail-656097-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","entity-relationship-diagrams-in-mysql-workbench-create-and-edit-an-erd-from-scratch","Entity Relationship Diagrams in MySQL Workbench - Create and Edit an ERD from Scratch","","The material explains what an Entity Relationship Diagram is and how it models database architecture through entities, attributes, and relationships. It reviews ERD terminology and demonstrates building an ERD in MySQL Workbench from scratch rather than using reverse engineering. The guide covers creating tables, defining primary keys and foreign keys, assigning datatypes, enabling constraints like not null and auto-increment, and connecting tables using the correct relationship type.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/entity-relationship-diagrams-in-mysql-workbench-create-and-edit-an-erd-from-scratch/656097/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/entity-relationship-diagrams-in-mysql-workbench-create-and-edit-an-erd-from-scratch/656097.png","ImageObject",300,407,{"name":92,"@type":93},"Syukur Setiap Hari","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-10-26","2026-10-25",true,{"@type":102,"interactionType":103,"userInteractionCount":81},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What does an Entity Relationship Diagram (ERD) represent in a database?","Question",{"text":112,"@type":113},"An ERD is a visual representation of the information stored in a database and how that information relates. It acts like a snapshot of database architecture to help you understand how the data you work with is connected.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do primary keys and foreign keys work in the ERD?",{"text":117,"@type":113},"A primary key is a unique identifier attribute for an entity table. A foreign key is a column in one table that references the primary key of another table, and it should correspond to an existing row in the referenced table.",{"name":119,"@type":110,"acceptedAnswer":120},"What are the steps to create an ERD from scratch in MySQL Workbench?",{"text":121,"@type":113},"Create a new model, add a diagram, place new tables for users and addresses, define columns with datatypes, set the users id as primary key with not null and auto-increment, and then connect the tables using the appropriate relationship icon to draw the relationship and generate the foreign-key attribute.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},656097,1793030381,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":81,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":29,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144},962093541965,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Tracks Course Assignment Checklist Stats Take Exams  \nEntity Relationship Diagrams in MySQL Workbench  \nObjectives:  \n Review the terminology associated with ERDs  \n Create an ERD in MySQL Workbench  \nWe introduced ERDs in the \"Reverse Engineering\" lesson. In this lesson we will create the ERD \"from scratch\" instead of by reverse engineering it from an existing database.  \nWhat is an Entity Relationship Diagram?  \nAn Entity Relationship Diagram is a visual representation of the information in the database and how it is related. It is a\"snapshot\" of the database architecture that can help you understand how the information you are working with is related.  \nThere are several variations of ERDs, but we are going to focus on the type we can create in MySQL Workbench.  \nEntities and Attributes  \nAn entity is essentially anything that can have information stored about it: It can be a person, thing, concept or event.  \nEach entity is assigned its own table which contains the attributes associated with the entity. An attribute is any information that we want to store for each entity. The attributes will become columns within the entity table.  \nPrimary and Foreign Key Constraints  \nLet's look at the example we have been working with. Below you can see that we have two entities (customers and addresses).  \nPrimary Key  \nOne of the attributes for each entity should be a unique identifier known as the primary key. The primary key in the customers table is id. The primary key in the addresses table is id. (As you can see, it is very common for the primary key tobe labeled as \"id\")  \nForeign Key  \nNote that a foreign key is a column in one table that references the primary key of another table. In our example above, the address_id is a foreign key in the customers table because it references the primary key in the addresses table. We would not want an address_id that did not correspond to an address!  \nAlso note that a table does not need a foreign key (the addresses table does not have one in this case), and that one table can have many foreign keys that would each refer to a different table.  \nWe are now going to create an ERD for a database that would store this information.  \n\n| Create an ERD in MySQL Workbench |  |\n| --- | --- |\n| First open MySQL Workbench, and from the File Menu click \"New model\" |  |\n| You will then click on the \"Add Diagram\" icon. |  |\n| |  |\n| Create and Edit a Table |  |\n| To add a table to the workspace, click on the \"Place a New Table\" icon and then click on your workspace (the gridded area). |  |\n| Alternately, you can use the keyboard shortcut (T) and then click on the workspace. |  |\n| You should now see your table on the workspace. To edit it, double click on the table. |  |\n\n| \u003Cbr>An edit view will appear at the bottom of your screen. |  |\n| --- | --- |\n| |  |\n| First, change the name of the table to \"users\". Then we will add each attribute as a column in our table.\u003Cbr>As we add each column, we will also assign it the desired Datatype. ( Review the Data Types Lesson if necessary)\u003Cbr> id (INT)\u003Cbr> first_name (VARCHAR(45))\u003Cbr> last_name (VARCHAR(45))\u003Cbr>Also, to follow our conventions, we will add\u003Cbr> created_at ( DATETIME)\u003Cbr> updated_at ( DATETIME)\u003Cbr>The created_at and updated_at columns can be automatically set to the current date/time by adding these expressions: created_at NOW()\u003Cbr>updated_at NOW() ON UPDATE NOW()\u003Cbr>|  |\n\n\n| There are also several boxes available to check. For now, we want to ensure that our id is the primary key ( PK), not null ( NN), |  |\n| --- | --- |\n| and is also auto incremented (AI) so we will check those boxes. We will not check boxes for any other columns. |  |\n| Note: Recall that address_id (INT) is a foreign key. MySQL will automatically add foreign keys when we connect our tables so |  |\n| do not include it yet. |  |\n| |  |\n| Note the symbols on the left of each attribute in your table. You will see a golden key to indicate a primary key. Now that we have created the fir","cbCaimmn6rkt2EZT","https://ap.wps.com/l/cbCaimmn6rkt2EZT","pdf",1326754,"English","# Objectives\n## ERD terminology and purpose\n# Entities and Attributes\n# Primary and Foreign Key Constraints\n# Create and Edit an ERD in MySQL Workbench\n## Create tables (users, addresses)\n## Edit columns and datatypes\n## Set PK/NN/AI and apply foreign key logic\n## Connect tables (1:1) and rename FK column","[{\"question\":\"What does an Entity Relationship Diagram (ERD) represent in a database?\",\"answer\":\"An ERD is a visual representation of the information stored in a database and how that information relates. It acts like a snapshot of database architecture to help you understand how the data you work with is connected.\"},{\"question\":\"How do primary keys and foreign keys work in the ERD?\",\"answer\":\"A primary key is a unique identifier attribute for an entity table. A foreign key is a column in one table that references the primary key of another table, and it should correspond to an existing row in the referenced table.\"},{\"question\":\"What are the steps to create an ERD from scratch in MySQL Workbench?\",\"answer\":\"Create a new model, add a diagram, place new tables for users and addresses, define columns with datatypes, set the users id as primary key with not null and auto-increment, and then connect the tables using the appropriate relationship icon to draw the relationship and generate the foreign-key attribute.\"}]","Entity Relationship Diagrams in MySQL Workbench - Create and Edit an ERD from Scratch | PDF",1792966309,15]