Solved

Relelationship

Posted on 2013-11-14
7
173 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
7 Comments
 
LVL 84

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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 31

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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This article will show you how to use shortcut menus in the Access run-time environment.
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

832 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