I have a model i'm building in workbench, and one of the tables is a many-many relationship table with a composite key made up of 3 integer values: the two foreign keys that make up the many-many relationship, and an additional identifier whose details are not relevant to my question.
I can see how in the model tab of the workbench I can tick off the checkbox to make all 3 values a component of the primary key (and it's index) and that seems to be working just fine, but when I go to the EER Diagram tab - I only see one of the columns with a key icon next to it.
Is there an additional step here, or is there something I'm missing?
EDIT: see attached screenshot - sorry about the yellow obscuring boxes - my company would not be pleased if I posted details, even on something so simple.
If you wish to create a composite primary key you can select multiple columns and check the PK check box. However, there is an additional step that is required, you must click the Indexes tab, then in the Index Columns panel you must set the desired order of the primary keys.
The attribute which uniquely identifies each entity in the entity set is called key attribute. For example, Roll_No will be unique for each student. In ER diagram, key attribute is represented by an oval with underlying lines. An attribute composed of many other attribute is called as composite attribute.
You can use aggregate function count(*). If it returns a value greater than 1, that would mean the table has composite primary key.
In a table representing students our primary key would now be firstName + lastName. Because students can have the same firstNames or the same lastNames these attributes are not simple keys. The primary key firstName + lastName for students is a composite key.
This is a bug that has been reported. See here: https://bugs.mysql.com/bug.php?id=92141
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With