var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I need help regarding constraints concept
When modeling many-to-many relationship in ERD we transform it into a separated table in relational model. That table must contains PK of both entities and foreign keys to that PKs.
Let's just say I have
entity1 = id, attributes
entity2 = id, attributes
So, the many-to-many relationship would be
relationship = id1, id2, FK id1=entity.id, FK id2=entity2.id, PK id1,id2
I don't know whether we need to add PK constraint to that table or not. I suppose we need because a table need a PK. Is my way above the correct way to do many-to-many relationship?
Or make it like this?
relationship = id, id1, id2, FK id1=entity.id, FK id2=entity2.id, PK id
no, you should not have a separate id for the PK
do it the first way you said --
CREATE TABLE relationship
( id1 INTEGER NOT NULL
, id2 INTEGER NOT NULL
, PRIMARY KEY ( id1, id2 )