PowerDesigner how to set unique keys but not primary keys

Source: Internet
Author: User
Tags powerdesigner

UNIQUE Constraint

A unique constraint is essentially the same as creating a unique index, because when a unique constraint is created, the system creates a unique index that implements the constraint through a unique index. However, the unique constraint more intuitively expresses the uniqueness of the corresponding column, making the purpose of the corresponding index clearer, so it is generally recommended to create a unique constraint instead of just creating a unique index.

The operation to create a unique constraint in PD, in the classroom table, Roomid is the primary key, must be unique, roomname if we are going to have to be unique, then the specific operation is as follows:

In the model design panel of PD, double-click the Classroom table, open the Properties window, switch to the Keys tab, and see a row of data pk_classroom, which is a primary key constraint. Add a row of data, named Uq_roomname, you cannot select the "P" column on the right, then click the toolbar's Properties button, pop up the uq_roomname Properties window, switch to the Columns tab, click the Add Column button, choose to add the Roomname column to it, Then click OK to complete the addition of 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.