I am be assailed with this relation type and trying to figure it out. I have two entities A (aid, ...) and B (bid, aid ...). for A 'aid' is the primary key, for B 'bid' is the primary key and 'aid' is the foreign key referencing A(aid). A may has 0 or 1 entity B but B must corresponds to 1 entity A, the relation between them can be described as
A (1..1) —— (0..1)B. so I think when creating table for B, bid is not necessary, aid can be the foreign key and also the primary key. please correct me if I think wrongly.
I have looked up for this case in a database book. it keeps the 'bid' in the table.
"aid" should be a key in B (the (0..1) part of the constraint). Whether you also need "bid" depends on what that attribute means in your data model. Presumably you are implying that "bid" is just surrogate key that can be dropped without losing any information. Is that right?