THỨ TƯ,NGÀY 22 THÁNG 4, 2020

Just how to describe matchmaking ranging from dining tables in the an access databases

Bởi Nguyễn Phùng Khuân

Cập nhật: 17/08/2022, 01:09

Just how to describe matchmaking ranging from dining tables in the an access databases

Work environment 365 ProPlus will be rebranded to help you Microsoft 365 Software to own organization. To learn more about this transform, peruse this blog post.

Novice: Means expertise in an individual software on solitary-member hosts. This post enforce in order to an excellent Microsoft Accessibility database (.mdb otherwise .accdb).

Bottom line

  • What are desk dating?
  • Categories of table relationship
  • One-to-of several dating
  • Many-to-of several relationship
  • One-to-one dating
  • How-to establish a-one-to-of many otherwise that-to-you to dating
  • Tips establish a plenty-to-of a lot matchmaking

What exactly are dining table relationships?

Inside the a great relational databases, relationships enable you to end redundant studies. Such as for example, while developing a databases that may track information about courses, you might have a table titled “Titles” you to areas information regarding for each and every publication, including the book’s title, time out-of publication, and you may blogger. There is also recommendations that you have to have to save throughout the the fresh creator, such as the publisher’s telephone number, target, and you may Area code/Postal Code. If you were to store this guidance in the “Titles” desk, the fresh new publisher’s contact number might be recurring for each and every name that the latest creator designs.

The solution is always to store the fresh publisher’s guidance just one date, for the another desk that people will-call “Publishers.” You might then place a tip throughout the “Titles” desk you to definitely records an entrance on “Publishers” table.

So that your investigation stays synchronized, you can demand referential ethics ranging from tables. Referential integrity relationship help make sure that information in a single desk matches suggestions in another. Such as for instance, for each label regarding the “Titles” table should be on the a particular author about “Publishers” table. A concept can not be put in the brand new database to possess an author that will not can be found regarding the databases.

Kinds of dining table matchmaking

A love works by matching data during the key columns, usually columns (or industries) with an identical term both in tables. Most of the time, the partnership links an important secret, and/or unique identifier column for every line, in one desk so you can an area in another desk. This new line regarding almost every other desk is known as this new “overseas trick.” For example, if you wish to tune transformation each and every book title, you make a relationship between your top trick line (let us call-it term_ID) throughout the grizzly desktop “Titles” dining table and you may a line about “Sales” desk which is named label_ID. Brand new title_ID line regarding “Sales” dining table ‘s the foreign trick.

There are about three types of dating anywhere between tables. The sort of relationship that’s created depends on the way the associated articles is laid out.

One-to-of several matchmaking

A-one-to-of many matchmaking is considered the most preferred style of matchmaking. Inside sorts of dating, a row in dining table A might have numerous complimentary rows from inside the table B. However, a row in desk B have just one complimentary row inside desk A beneficial. Including, new “Publishers” and “Titles” tables has actually a single-to-of many matchmaking. That is, per writer supplies of numerous headings. But each term originates from just one publisher.

A single-to-many matchmaking is done if only among the associated columns try a primary secret or have a separate restriction.

Regarding relationships screen in the Availability, the key trick edge of a single-to-of numerous matchmaking is actually denoted of the a #1. This new international trick side of a love is actually denoted from the an infinity icon.

Many-to-of a lot matchmaking

Within the a plenty-to-of several relationship, a row when you look at the dining table A could have numerous matching rows during the dining table B, and you will vice versa. You make instance a love because of the defining a third dining table one to is named an effective junction desk. The primary secret of your own junction desk includes the foreign tactics from both desk An excellent and you can desk B. Including, the “Authors” dining table together with “Titles” desk provides a countless-to-of a lot relationship that is discussed by the a single-to-of many relationship out-of each one of these tables toward “TitleAuthors” table. The key secret of one’s “TitleAuthors” table is the mix of the newest bien au_ID column (the fresh new “Authors” table’s primary key) plus the title_ID line (the latest “Titles” table’s no. 1 secret).

Bình luận

Tôn trọng lẫn nhau, hãy giữ cuộc tranh luận một cách văn minh và không đi vượt quá chủ đề chính. Thoải mái được chỉ trích ý kiến nhưng không được chỉ trích cá nhân. Chúng tôi sẽ xóa bình luận nếu nó vi phạm Nguyên tắc cộng đồng của chúng tôi

Chưa có bình luận. Sao bạn không là người đầu tiên bình luận nhỉ?

SEARCH