Search code examples
databaseentity-relationshiperdvisual-paradigmcandidate-key

Candidate key constraint in Visual Paradigm 12.1


Is there any way to (visually) enforce candidate key constraint on an entity in an entity-relationship diagram in Visual Paradigm 12.1?

For example we have an entity called Address (street, city, state, zipcode). I want to store the attributes (id, street, city, state, zipcode) BUT I want to enforce that the combination (street X city X state X zipcode) is unique.

1 X James avenue X New York X USA X 123 is OK

2 X James avenue X New York X USA X 123 is NOT OK

This is an example in VP 12.1.

enter image description here

The problem is it means

street is unique AND
zipcode is unique AND
city is unique AND
state is unique

It should mean

Combination of street AND zipcode AND city AND state is unique.

Solution

  • I'm not an expert on Visual Paradigm, but AFAICS it doesn't visually distinguish between individual and composite unique constraints.

    In addition to properly specifying the composite key for the generated SQL, how about using foreground or background colors to visually associate the components of a composite key? For example:

    Visual Paradigm composite key with coloring

    Oracle's SQL Data Modeler displays a composite key in the same way as Visual Paradigm. MySQL Workbench does it a little better, showing indices and highlighting its components when the mouse moves over an index:

    MySQL Workbench composite key