What are database relationships? |
[Edit] |
Answer
The question is too vague for a sound answer so I will try to shotgun it. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
The most basic relationship is a parent-child relationship. The parent table might be "Department," the child table, “Employee.” The child can not exist without a parent. Bob and Jill may be children in the Shoe department. Mary is the child in the Canoe department. The Glue department has no children; Harry was the only employee but they had to let him go over a sticky situation.
As you can see, a parent might have many children, one child, or no children.
Quantity relationships are the next type of relationship the question may be asking about. Quantity relationships do not have to be between parent and child tables.
As you can see, Departments can have many children. That is known as a one-to-many relationship. One department, many employees.
A many-to-one relationship might be a customer with multiple addresses, say mailing, billing, and shipping.
Employee and Employee Number tables might represent one-to-one relationships. Rather than use Mary Boudreaux every place you need to identify her, you assign her an employee number. Mary is in the Canoe department. Her number is C75. C for Canoe, 75 for the 75th employee of the company.
Finally, there is the many-to-many relationship. All the employees work for commission. There is a sales table with many entries. Each entry is related to one of the many employees in the employee table.
There are symbols for each X-to-Y relationship.
The question might also refer to “Key” relationships. Primary Keys (PK) and Foreign Keys (FK) are used mostly between tables. A full explanation of the PK/FK relationship usually results in glazed eyes and confusion without visuals.
First answer by ID1262591011. Last edit by ID1262591011. Question popularity: 29 [recommend question]
|
Research your answer: |



