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.