Meaning of "Direct Relationship" in an ERD.

In summary, a direct relationship between two entities means that the object or datum exists in two contexts and both have to there to make the relationship function. A foreign key is an example of a direct relationship.
  • #1
WWGD
Science Advisor
Gold Member
7,311
11,120
Hi all, I am trying to understand the meaning of "Direct Relationship" between two entities belonging to an ERD, i.e., an entity-relation diagram associated with a Relational database. A Google search did not return anything helpful.
Say, A,B are the entities in question. I assume this means that there should be an arrow joining them, i.e., A,B are incident with each other. Or does it mean that there is a path joining A with B?
 
Technology news on Phys.org
  • #2
A direct relationship simply means the object or datum exists in two contexts and both have to there to make the relationship function.

A foreign key is an example. The parent table has a unique key for each row, Dog_breed, like basset hound or collie. The"child" table has an instance of a collie named fred. Since this is a foreign key relation ship, the Dog_breed in the child table is "collie" which references the parent, and the dog's name "Fido", which is the local key.

So these rules for Dog_breed apply:
It is never NULL in either table.
Any entry in the child table can only have Dog_breed values found in the parent.
The parent may have only one entry for each Dog_breed, the child may be a repeating table with lots of collie.

Good design dictates that each child row in a repeating table has a unique "key", it may just be a combination of breed, name, and owner, or some kind of non-repeating sequence. Or a combination of all four fields. That way you can distinguish rows based on some fixed data attribute rather than the physical location of the row - which can change, e.g. via a table reorg.
 
  • Like
Likes WWGD
  • #3
Thanks, Jim, I guess this is then equivalent, given tables A,B,C , that A,C are related in the primary key PK(A) appears as FK(C)?
 
  • #4
That is it, you have it. Note - you make the rules when creating the database. Poor rules == poor design.
 
  • Like
Likes WWGD

FAQ: Meaning of "Direct Relationship" in an ERD.

1. What is a direct relationship in an ERD?

A direct relationship in an ERD (Entity Relationship Diagram) is a type of connection between two entities that shows a one-to-one or one-to-many relationship. This means that one entity is dependent on the other, and the relationship is represented by a solid line connecting the two entities.

2. How is a direct relationship different from an indirect relationship in an ERD?

A direct relationship is a direct connection between two entities, while an indirect relationship is an indirect or secondary connection between two entities. In an ERD, indirect relationships are represented by a dotted line connecting the two entities.

3. Can a direct relationship exist between more than two entities in an ERD?

No, a direct relationship can only exist between two entities in an ERD. However, multiple direct relationships can exist between different pairs of entities in the same diagram.

4. How is a direct relationship represented in an ERD?

A direct relationship is represented by a solid line connecting the two entities involved in the relationship. The line may also have symbols or labels indicating the type of relationship, such as "1" for one-to-one or "1:N" for one-to-many.

5. What is an example of a direct relationship in an ERD?

An example of a direct relationship in an ERD is the relationship between a customer and their order in a retail database. One customer can have multiple orders, but each order can only belong to one customer, creating a one-to-many direct relationship between the two entities.

Similar threads

Replies
4
Views
981
Replies
9
Views
2K
Replies
41
Views
3K
Replies
5
Views
1K
Replies
62
Views
2K
Replies
1
Views
2K
Back
Top