Physical model Diagram-database diagram

Source: Internet
Author: User

1. New physical model Diagram File----New model----INFOMATION---physical Data

1: Open PowerDesigner, then click File-->new Model and select the physical data model as shown

(The physical data model name itself, and then select the database you use)

(The main page is created, but the button on the right is slightly different from the conceptual model, and the three most commonly used physical models are table (table), view, reference (relationship));

(Mouse first click on the right table this button and then in the new physical model point, you can create a new table, and then double-click New as shown, in the general name and code to fill in their own needs, click on the application can), such as:

(then click Columns, such as settings, Gray is often simple, it is necessary to note that the P (primary primary key), F (foreign key foreign key), M (mandatory mandatory, Representative cannot be empty) these three, read a few times to understand its meaning. )

(In this setting the number of the self-increment (MySQL inside is this auto_increment), class number the same, do not make more verbose! )

(At this point below the check mark, you set the self-increment)

(all finished as shown.) )

(The class physics model is similarly created as shown)

(as shown after completion)

The above settings as shown, and then below is the key place, click on the right button reference this button, because the class is a pair of students, so the mouse from the students to the class as shown, the student table will change, the student table is added a row, this line is the primary key of the class table as the foreign key of the student table, Associate the Class table with the student table. (You can see the difference by careful observation.) )

(Do the above operation, you can double-hit a line between, display, such as, modify name and code)

(However, it is important to note that the results shown after the modifications are shown, there is no way to directly like the conceptual model, the changes appear in the middle of the line above, the reader to understand, you can also use other buttons to add their own comments can also be.) such as text This button can also be added, easy to read)

(Learn a lot of one or a pair of relationships, the next learning many pairs of relations, the same kind of self-built teacher's table, here is not in the narrative, remember the teacher number self-increase, built as shown)

(Here is the key to many-to-many relationships, because the physical model of many-to-many relationships requires an intermediate table to connect, such as, set only one field, primary key, self-increment)

(click Apply, then Set columns, add only one field)

(This is the Set field increment, which has been described several times before.)

(set as shown below) (Note that there is a side of the arrow is a, no arrow of the party is more, that is, one-to-many relationship needs to be clear, students can have a lot of teachers, teachers can also have a lot of students, so students and teachers can be the main body, that is, male/female pig feet);

(you can see the changes that have occurred before and after the relationship between the student and the teacher after the relationship was added)

Physical model Diagram-database diagram

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.