Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COyour advice is contradictory isn't it? By suggesting that you need a "unique index" I understand you to mean that the composite key constraint should be enforced in that way. Therefore that it is still a de-facto composite key. There's nothing wrong with composite keys - they are a good thing. But in my opinion they are better if created explicitly by unique constraints (SQL UNIQUE or PRIMARY KEY constraints for example) rather than implicitly through indexes. That's assuming the DBMS in question supports unique constraints.
      singulars
    2. COA unique index is not a composite key. It is not used to relate to other tables and thus is not a KEY at all. The reason why you don't want composite keys is that in relating to other tables you need to have the smallest key possible for performance. You also need something whose values will never change and that is extremly rare with composite keys. I would never consider using a database that didn't allow unique indexes, that would be just a toy not a real database.
      singulars
    3. COA key is not just something that is "used to relate to other tables". A candidate key is a set of column attributes that is required to be unique and is irreducibly so. A composite key is any candidate key with more than one attribute. Composite keys are therefore essential for effective database design. Whether any such key is referenced in another table is a different question. Also, it's quite possible for a composite key to be smaller than a single attribute key. Size is certainly a factor but it's not the only one and is rarely the most important.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload