Tips for using PowerDesigner for Database Design

Source: Internet
Author: User
Tags comparison table powerdesigner

When we use Power Designer (PD, I am using PD 12) for database design, generally, we first design a Conceptual Data Model that is closer to our logical thinking, and then automatically generate a Physical Model (Physical Data Model) based on the Conceptual Model ), then, manually adjust the generated physical Model. At this time, the adjusted object is mainly the error and warning information checked by the Check Model, then generate the database script and run it in the database to generate the real database.

We will add both the conceptual and physical models to the project and save them. When we need to modify the database design, we will modify the conceptual model and then generate the physical model, in this case, the physical model is generally updated based on the previously generated physical model, so that you do not have to adjust the previously manually adjusted part again. The PD will display the updated part in the form of a comparison table.

The following are some basic skills used to design conceptual models using PD. Some of them may be common sense, but I think they are very important, so I listed them as follows:

1. Like some other UML design tools, PD supports two methods to create objects. One is to right-click the Browser and select "new ", at this time, only one object will be created in Browser; the other is to add an object to the drawing area through the Toolbox (Palette). In this case, PD creates an object in Browser, A symbol is added to the drawing area ). Select symbol in the drawing area. If you select Delete, only the symbol is deleted. The corresponding object is not deleted. If you select Delete in the Browser, the object and all the symbrs belonging to the object are also deleted.

2. Data Item: Data with the same meaning can be designed as Data items. For example, "Start time", and then re-use (Reuse) or Add (Add) the data item in the Entity that needs to be added "Start Time. In this way, as long as you modify the attribute of the "Start Time" data item, all corresponding data in the entity that has reused the data item will be modified.

3. Relationship: indicates a one-to-many Relationship. For example, for "product type table" and "Product table", you do not need to reuse or add a data item "product type encoding" (primary key of the product type table) in the "Product table, you only need to add a table from "product type table" to "Product table "(Direction). A "product type encoding" foreign key field is automatically added to the generated physical model and maintains the relationship with the "product type table.

4. Association: The Association between two entities can be expressed by Association rather than entity. For example, the Association "Student table" and "Course table" has only three fields: "student ID" (primary key of the student table) and "course number" (primary key of the curriculum) and "score ". You can create a new union with only one "score" field, and then add an Association Link (No direction) Connect the "Student table" and "Student table", and add an Association Link to connect the "Course table" and "Student table. In this way, the "tables Table" in the generated physical model automatically contains the preceding three fields.

5. Package: When the designed database contains many entities and may be logically distributed across multiple subsystems, packages can be used to separate them. For example, the entire database can be divided into A, B, and C3 packages according to the logic. A contains the entity tables to be accessed by the entire system, and B contains the entity tables accessed by subsystem B, C contains the entity tables accessed by subsystem C, which are more hierarchical and clearer after the design. If necessary, packages can be subcontracted.

6. shortcut: After subcontracting, the following problems will naturally occur: Table B in subsystem Package B needs to establish A primary-foreign key relationship with a in Public Library Package, table C in subsystem Package c needs to reuse the data item in Public Library Package A. To solve such problems, use shortcuts. Select the entity A or item in Package a, select Ctrl + C, right-click Package B or C, and choose edit & Paste as shortcut key ", a shortcut for a or item is added to B or C. In this case, you can easily add a primary foreign key relationship or reuse data items.

7. Reverse Engineering: if you do not know how to use PD to implement some database features, you can use reverse engineering to test it. For example, you can design a Demo database in a real database environment to implement the features such as the primary-foreign key relationship and union, and then generate a physical model through reverse engineering of PD, then generate the conceptual model, then we can see how the PD corresponds to these features, and then design your own database according to the corresponding rules, which includes the features you want.

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.