Solved

Relelationship

Posted on 2013-11-14
7
177 Views
Last Modified: 2013-11-14
Hello All,

When does it make sense to do a one – one relationship in DB? Can anyone explain in layman’s terms?

Thank You
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 100 total points
ID: 39648304
If you have entirely different entities that can only belong to another single, unique entity. For example, a Drivers License can belong to a single Person. The "Person" and "DriversLicense" are distinctive entities, and they have different attributes, but they really shouldn't be listed in the same table.
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 100 total points
ID: 39648308
an example is an employee table..
you can divide the information into two parts
one part is the common information, like names, location, tel (non sensitive Info)
the other part contains the sensitive information that will only be available to certain people

you then join the two table using the employeeID
0
 
LVL 39

Assisted Solution

by:Roger Baklund
Roger Baklund earned 100 total points
ID: 39648323
Use it for optional data, i.e. when some column(s) are rarely used.

For example, if you have a person table with many persons, and for a few persons you want to store some notes and a pic:

Person:
  person_id INT
  name VARCHAR
  addr VARCHAR
  zip INT
  city VARCHAR

Person_notes:
  person_id INT
  note TEXT

Person_pic:
  person_id INT
  pic BLOB

Putting the pic and note columns in the main table works too, but if the person table is large, it will be a waste of disk space (even empty columns consume some space).
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 70

Assisted Solution

by:KCTS
KCTS earned 50 total points
ID: 39648479
Relationships are used to 'link' using a field that's common to two different sets.

Suppose you have a list of employees
EmployeeID
EmployeeSurname
EmployeeFirstName
EmployeeDOB
SiteWorkedAt

and list that records the company sites
SiteID
SiteAddress
SitePhoneNumber

You would create a relationship between the two tables linking SiteID to SiteWorkedAt

This means that you only record the site details ONCE no matter how many people work there - this makes the database more efficient and smaller -  and if something changes - like the SitePhoneNumber, you can change it in ONE place.
0
 
LVL 33

Accepted Solution

by:
Paul Sauvé earned 75 total points
ID: 39648481
To further illustrate LSMConsulting's comment:
>>If you have entirely different entities that can only belong to another single, unique entity. For example, a Drivers License can belong to a single Person. The "Person" and "DriversLicense" are distinctive entities, and they have different attributes, but they really shouldn't be listed in the same table.

This Person can have 1 drivers permit and three vehicles. He needs 1 drivers permit and 1 registration for each vehicle.

If the person changes address and there was no 'Person' table, then the address would have to be changed in FOUR records, thus increasing the possibility of error. By separating the "Person" information, you only update ONCE!

Also, you will have a 1:1 relationship between the "Person" and "DriversLicense" entities and a 1:n relationship between the "Person" and "VehicleRegistration" entities... This process is called NORMALIZATION of a database!
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 75 total points
ID: 39648657
In my opinion ... never.
At a minimum, it complicates most other aspects of a design. Queries are more complicated, Record Sources are more complicated and so on.
0
 

Author Closing Comment

by:Rayne
ID: 39648810
Awesome Guys, This is awesome. Thanks  a million.  I was confused.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question