Database modeling using Erwin and Erstudio (by quqi99) __ Database

Source: Internet
Author: User

database modeling using Erwin and Erstudio (by quqi99)


Author: Zhang Hua published in: 2007-10-25 (http://blog.csdn.net/quqi99)

Copyright NOTICE: You can reprint, reprint, please be sure to hyperlink form to indicate the original source and author information and this copyright notice.

There are two views of logical view and physical view in Erwin.

First of all, modeling in logical view, in the left tree entities midpoint "new" can build a table, after the completion of a table, you can build a property in this table (on the attributes right click). The external constraint is defined in key groups, the primary key definition well, it is worth mentioning the foreign key, for example, there are two tables (User table: Id,deptid,name Dept Table: deptid,name), the user table and the Dept table is a many-to-many relationship, DeptID in the user table as a foreign key, the primary key of the Dept table must be the same as the DeptID, because the foreign key cannot be selected when the foreign key constraint relationship is built. It's OK to pay attention to this.

Then, in physical view, you can synchronize these defined tables directly into the physical database. Only in this view, point "tools"----"Schema generator" can be.

----------------------------------------------------------------------------------

In Erstudio, when you first build entities, when you build a foreign key constraint, for example, there are two tables (User table: Id,deptid,name Dept Table: Deptid,name), and the user table is a many-to-many relationship to the Dept table. The DeptID in the user table acts as a foreign key. Table User (Id,name) should be built first. (Note that the DeptID attribute is not built first), and then enter deptid This field in the process of building the relationship.

When you finish generating the logical view, right-click on it to generate the physical model. Follow the prompts

After the physical view is generated, right-click on it to generate the database, including directly building tables and exporting SQL statements in the database.

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.