One-to-One Relationship

Định nghĩa One-to-One Relationship là gì?

One-to-One RelationshipOne-to-One Mối quan hệ. Đây là nghĩa tiếng Việt của thuật ngữ One-to-One Relationship - một thuật ngữ thuộc nhóm Technology Terms - Công nghệ thông tin.

Độ phổ biến(Factor rating): 5/10

Một mối quan hệ một-một trong một cơ sở dữ liệu quan hệ xảy ra khi kỷ lục một phụ huynh hoặc trường có hoặc không hoặc một bản ghi con duy nhất. Những mối quan hệ là dễ nhất để đại diện trong cơ sở dữ liệu vì cả phụ huynh và các hồ sơ trẻ có thể nằm trong cùng một bảng.

Xem thêm: Thuật ngữ công nghệ A-Z

Giải thích ý nghĩa

Như một ví dụ, trong bảng CUSTOMER_MASTER trong cơ sở dữ liệu của ngân hàng, mỗi khách hàng được đại diện bởi một CUSTOMER_ID độc đáo, cũng là khóa chính của bảng. Mỗi khách hàng cũng có thể có một chính phủ cấp thẻ an sinh xã hội, trong đó có một số an sinh xã hội độc đáo. Do đó, mỗi khách hàng phải có một ID khách hàng duy nhất trong cơ sở dữ liệu của ngân hàng. Nếu khách hàng thực hiện có một, sau đó chỉ có thể có một số an sinh xã hội cho mỗi khách hàng. Trường mẹ (CUSTOMER_ID) có một one-to-one mối quan hệ với các lĩnh vực an sinh xã hội. Đối với các mối quan hệ như vậy, cách tốt nhất là đặt chúng vào một bảng để dễ tham khảo. Trong trường hợp này, số an sinh xã hội đơn giản nên một cột bổ sung trong bảng CUSTOMER_MASTER.

What is the One-to-One Relationship? - Definition

A one-to-one relationship in a relational database occurs when one parent record or field has either zero or one child record only. These relationships are the easiest to represent in databases because both the parent and child records may be in the same table.

Understanding the One-to-One Relationship

As an example, in the CUSTOMER_MASTER table in a bank’s database, each customer is represented by a unique CUSTOMER_ID, which is also the table’s primary key. Each customer may also have a government issued social security card, which contains a unique social security number. Therefore, each customer must have a single customer ID in the bank’s database. If a customer does have one, then there can only be one social security number per customer. The parent field (CUSTOMER_ID) has a one-to-one relationship with the social security field. For such relationships, it is best to put them into one table for ease of reference. In this case, the social security number should simply be an additional column in the CUSTOMER_MASTER table.

Thuật ngữ liên quan

  • Many-to-Many Relationship
  • Primary Key
  • Entity-Relationship Diagram (ERD)
  • Entity
  • Attribute
  • Named-Entity Recognition (NER)
  • Relational Database (RDB)
  • Record
  • Database (DB)
  • Enterprise Resource Planning (ERP)

Source: ? Technology Dictionary - Filegi - Techtopedia - Techterm

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *