Use of DRP PowerDesigner

Source: Internet
Author: User

We use PowerDesigner to create a table and generate an SQL script. Therefore, PhysicalDateModel is used to create a physical model.

Open PowerDesigner, click File> Now Model, and select Categories> Information> PhysicalData ), create a new name for the model and select DBMS (Database Management System). I plan to use oracle11g. the following default Share the DBMS definition (Share resources ). click OK.

The whole interface is such a block. (This is reduced)

Then you can start creating the table. because there are many tables, they are divided into classes and placed in different blocks. for example, system management. in the toolbar, the T icon is required. Click. In the model, a default text is displayed. select the arrow and double-click it to bring up Text and edit the content. you can use the green A tool to modify the font size and color.

This is T, the effect of text.

 

 

The following tools are commonly used: create tables, View, and Reference ).

Drag the table into the block. Double-click it to bring up the table property form. Edit the table name and table field.

Select Columns and edit Columns (fields ). enter the name, column code, and data type. select whether it is a primary key or not. user code is the primary key of the user information table. User code, user name, and password are not empty.

If you have a detailed description of the column, you can click the attribute identifier to describe the column attributes in detail.

You can set the default value for some fields.

You can also preview the code of the created table.

If a table is associated with another table with a foreign key, the same is true for auto-join. the primary key of the associated table is used as the foreign key and added to the table. you can modify the Name and Code, but the type cannot be modified.

In this way, you can create a table.

 

If you want to create a view, the difference is that you can directly create columns for a table, but the view is equivalent to an SQL query statement, so it is written using an SQL statement.

Click View tool to create a view.

Then, write the Query statement in the SQL Query of the view attribute.

 

After creating a table, you can generate an SQL script and directly create a database in the database.

Before generating a script, you must check whether the model is correct to generate an SQL script.

If an error occurs, you need to modify the error. The yellow exclamation point is a warning. The warning can be left unchanged. The red X must be modified.

These problems in the figure are due to many duplicate associations.

PowerDesigner provides the automatic modification function.

 

This is the case after the modification. By adding numbers, the association is not renamed.

 

Finally, generate an SQL script.

 

This page is displayed. For database conventions, you can select the script address and Script Name.

After confirmation, the generated script is like this. But there is a problem, there are quotation marks on the table name, this quotation mark powerdesigner has a solution.

Select from the menu tool. tools --> Model Options --> Naming Convertion --- Code ---> Character case (Character type ), from the original Mixed Case (Mixed) to Uppercase (Uppercase ).

Note that it cannot be changed to LowerCase (lower case). It will be the same as the above.

Finally, re-generate an SQL script. The result is that the table name is capitalized without quotation marks.

The above is to use powerdesigner to design tables and generate the whole process of SQL scripts. Tools make our system development very easy and easy. Therefore, we must be good at using tools.

 

 

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.