What is the relationship between commodity classification and commodity table?

Source: Internet
Author: User
Product Categories
ID CategoryName

Product List
ID Name CategoryName (the question is, here, the ID of the product category or the CategoryName of the commodity category)

Most people say to fill in the ID, but the product classification has been deleted, what about the product?
What is the problem with copying the CategoryName of the product category directly into the CategoryName of the commodity table?
Whether this is a matter of inverse paradigm design.

Reply content:

Product Categories
ID CategoryName

Product List
ID Name CategoryName (the question is, here, the ID of the product category or the CategoryName of the commodity category)

Most people say to fill in the ID, but the product classification has been deleted, what about the product?
What is the problem with copying the CategoryName of the product category directly into the CategoryName of the commodity table?
Whether this is a matter of inverse paradigm design.

I think we should fill in the ID, this conforms to the general principle.
If you fill in the classification name directly, it is not possible, but at least two problems: 1, if the name changes, you need to update all records, 2, from the query point of view, when the need to filter items according to the classification of the ID is faster than the classification name.

If the product classification is deleted, you will need to look for the commodity table if you fill in the ID or the classification name in the product table, otherwise the data is inconsistent.

  • 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.