Distinguish between the primary table and the table from the relational row database

Source: Internet
Author: User

1, in the database design often use the foreign key, beginners often confuse, according to my experience summed up a bit.

Main Table: A table is created in the database, where the primary key (primary key) is used to correlate with other tables and is identified as uniqueness in the primary table. (Excerpt from Baidu Encyclopedia)

from table: A table with the primary key (primary key) value of the main table as a foreign key (Foreign key), you can associate the query with the primary table by a foreign key. The query is associated with a foreign key from the table and the primary table. (Excerpt from Baidu Encyclopedia)

650) this.width=650; "Src=" https://imgsa.baidu.com/baike/c0%3Dbaike80%2C5%2C5%2C80%2C26/sign= 05e8a682013b5bb5aada28ac57babe5c/c83d70cf3bc79f3dd5004319b8a1cd11728b2931.jpg "alt=" c83d70cf3bc79f3dd5004319b8a1cd11728b2931 "/>

As shown in the previous figure, the table above is a child table , and the following is the Main table .

It is easy to understand that the primary key of the primary table is used as a foreign key, which is placed from the table as a foreign key.

Distinguish between the primary table and the table from the relational row database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.