Powerdesigner sets the unique key, but not the primary key.

Source: Internet
Author: User
Tags powerdesigner

Unique Constraint

The unique constraint is basically the same as creating a unique index, because when creating a unique constraint, the system creates a unique index and implements the constraint through the unique index. However, the unique constraint intuitively expresses the uniqueness of the corresponding column so that the purpose of the corresponding index is clearer. Therefore, we generally recommend that you create a unique constraint instead of only creating a unique index.

Create a unique constraint operation in PD. In the classroom table, roomid is the primary key and must be unique. If roomname is required to be unique, perform the following operations:

On the Model Design panel of Pd, double-click the "classroom" table, open the Properties window, and switch to the "" keys "tab. a row of Data pk_classroom is displayed, which is the primary key constraint. Add a row of data and name it uq_roomname. You cannot select the "P" column on the right. Then, click the "properties" button on the toolbar. The uq_roomname attribute window is displayed. Switch to the column tab, click the Add column button, select to add the roomname column to it, and click OK to add the unique constraint.

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.