Meaning of "Direct Relationship" in an ERD.

  • Thread starter Thread starter WWGD
  • Start date Start date
  • Tags Tags
    Relationship
Click For Summary
SUMMARY

The discussion clarifies the concept of "Direct Relationship" in an Entity-Relationship Diagram (ERD) within relational databases. A direct relationship is established when two entities, such as A and B, are connected by an arrow, indicating their interdependence. The example provided illustrates a foreign key relationship where a parent table (Dog_breed) and a child table (dog instances) must adhere to specific rules, such as non-null values and unique keys for child rows. Proper design principles dictate that relationships must be clearly defined to avoid poor database design.

PREREQUISITES
  • Understanding of Entity-Relationship Diagrams (ERD)
  • Familiarity with foreign key relationships in relational databases
  • Knowledge of unique keys and their significance in database design
  • Basic principles of database normalization
NEXT STEPS
  • Study the implementation of foreign keys in MySQL 8.0
  • Learn about database normalization techniques
  • Explore best practices for designing Entity-Relationship Diagrams
  • Investigate the implications of unique constraints in relational databases
USEFUL FOR

Database designers, software developers, and data analysts seeking to enhance their understanding of relational database relationships and improve database design practices.

WWGD
Science Advisor
Homework Helper
Messages
7,778
Reaction score
13,019
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
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   Reactions: WWGD
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)?
 
That is it, you have it. Note - you make the rules when creating the database. Poor rules == poor design.
 
  • Like
Likes   Reactions: WWGD

Similar threads

  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
4K
  • · Replies 62 ·
3
Replies
62
Views
5K
  • · Replies 11 ·
Replies
11
Views
5K
Replies
12
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K