Generating a database with an ER diagram in an ea

Source: Internet
Author: User

er diagram

The E-r graph, also known as the entity-contact graph (Entities Relationship Diagram), provides methods for representing entity types, attributes, and connections to describe the conceptual model of the real world.

Entity is to see the touch or can be perceived acceptance of the objective existence, the attribute is used to describe the entity, contact nature is the relationship between entities, only the mutual connection will complete a system function, directly:




In addition, the ER diagram can be drawn in the EA to help us clarify the relationship, and generate SQL script to build the database has saved a lot of time, improve efficiency

Draw ER Diagram

In addition to the EA can draw UML diagram also has a very powerful function, the general software used in the figure of the above have, such as Data flow chart, er diagram, er diagram how to draw it?

First, like building a general UML diagram, right-click to find a new chart, and then in the type bar to drag the list box to the end, see the Entity Relationship Diagram Click, in the choice of entity relationship on the right side can be




For a closer Look:




Er diagram of the basic is this, and there is a few pairs of relationship between the display, only need to right-click to select the order to set it can be

er diagram Generation database

How do you translate diagrams into the database we need after drawing the ER diagram?

1. First select the database we want to generate, this can be from the drawing before or after drawing, the difference is not big,






2. Convert to Data Model diagram, select all the entity and attribute names, right click, click Convert to appear


3. Select the ERD to Data Modeling option and save the location, click Start Conversion, convert to:



4. Any database table requires a primary key, foreign keys and constraints, we modify these tables below, select any one of the data table right-click appears






5. Follow the steps to set the primary key and data type for the table. In addition, we have to add a foreign key to it, select contact right click, select the foreign key, it can be set. This is done by modifying the basic. (But I still think it's better to build a table with SQL statements)

6. Finally, the diagram is converted into a table, select the data Model diagram, right-click, select "Code Generation"-"Generate Selected Elements", appears:




Description: Row Modify and select all objects. In file generation, you can select individual files, or you can choose to generate one file per table. Select "Produce one file per table"

Finally, just add the generated SQL script to the database and the execution is OK.

Summary:

You have to be preach on paper to be aware of it. This is the most basic step, in addition to generating database documentation and many other details waiting for us to discover. But clearing out how powerful the EA is, the ER diagram is part of one of his drawing functions, and using ER diagrams we can sort out functions and relationships and generate datasheets.




Generating a database with an ER diagram in an ea

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.