One-to-One Relationships

One-to-one relationships are an integral part of building a database

Database Planning
alexsl / Getty Images

One-to-one relationships occur when there is exactly one record in the first table that corresponds to one record in the related table. For example, U.S. citizens have a Social Security number. There is only one number that is assigned per person, and therefore, a person can't have multiple numbers.

Here's another example using the two tables below. The tables have a one-to-one relationship because each row in the first table is directly related to another row in the second table.

 

Employee NumberFirst NameLast Name
123RickRossin
456RobHalford
789EddieHenson
567AmyBond


So the number of rows in the employee names table has to be the same as the number of rows in the employee positions table.

Employee numberPositionPhone Ext.
123Associate6542
456Manager3251
789Associate3269
567Manager9852


Another type of database model is the one-to-many relationship. Using the bottom table you can see that Rob Halford, is a manager, so his relationship to the position is one-to-one because at this company a person only has one position. But the manager position includes two people, Amy Bond and Rob Halford, which is a one-to-many relationship. One position, many people.  

Learn more about Database Relationships, Foreign Keys, JOINs and E-R Diagrams.