filmov
tv
Create one to one relationships
Показать описание
What is a #one-to-one #relationship ?
One-to-one relationships are frequently used to indicate critical relationships so you can get the data you need to run your business.
A one-to-one relationship is a link between the information in two tables, where each record in each table only appears once. For example, there might be a one-to-one relationship between employees and the cars they drive. Each employee appears only once in the Employees table, and each car appears only once in the Company Cars table.
You might use one-to-one relationships if you have a table containing a list of items, but the specific information you want to capture about them varies by type. For example, you might have a contacts table in which some people are employees and other people are subcontractors. For the employees, you want to know their employee number, their extension, and other key information. For subcontractors, you want to know their company name, phone number, and bill rate, among other things. In this case, you’d create three separate tables—Contacts, Employees, and Subcontractors— and then create a one-to-one relationship between the Contacts and Employees tables and a one-to-one relationship between the Contacts and Subcontractors tables.
One-to-one relationships are frequently used to indicate critical relationships so you can get the data you need to run your business.
A one-to-one relationship is a link between the information in two tables, where each record in each table only appears once. For example, there might be a one-to-one relationship between employees and the cars they drive. Each employee appears only once in the Employees table, and each car appears only once in the Company Cars table.
You might use one-to-one relationships if you have a table containing a list of items, but the specific information you want to capture about them varies by type. For example, you might have a contacts table in which some people are employees and other people are subcontractors. For the employees, you want to know their employee number, their extension, and other key information. For subcontractors, you want to know their company name, phone number, and bill rate, among other things. In this case, you’d create three separate tables—Contacts, Employees, and Subcontractors— and then create a one-to-one relationship between the Contacts and Employees tables and a one-to-one relationship between the Contacts and Subcontractors tables.