How is this database structure designed?

Source: Internet
Author: User
language:+----------+------------------+| Field    | Type             |+----------+------------------+| id       | int(10) unsigned || language | varchar(45)      |+----------+------------------+country:+-------+------------------+| Field | Type             |+-------+------------------+| id    | int(10) unsigned || name  | varchar(45)      |+-------+------------------+goods:+--------------+------------------------+| Field        | Type                   |+--------------+------------------------+| id           | int(10) unsigned       || name         | varchar(200)           || model        | varchar(45)            || description  | varchar(200)           || price        | decimal(10,2) unsigned |+--------------+------------------------+

Demand:
1, 1 People do Commodity Information entry [basic information]
2, A, B, C countries for information localization, including Name,description,price and so on. The model is unique and does not need to be localized.
3, D countries found the language and basic information consistent, without localization, at this time read [basic information].
4, E countries can only localize prices, other information according to [basic information] to display.

Reply content:

language:+----------+------------------+| Field    | Type             |+----------+------------------+| id       | int(10) unsigned || language | varchar(45)      |+----------+------------------+country:+-------+------------------+| Field | Type             |+-------+------------------+| id    | int(10) unsigned || name  | varchar(45)      |+-------+------------------+goods:+--------------+------------------------+| Field        | Type                   |+--------------+------------------------+| id           | int(10) unsigned       || name         | varchar(200)           || model        | varchar(45)            || description  | varchar(200)           || price        | decimal(10,2) unsigned |+--------------+------------------------+

Demand:
1, 1 People do Commodity Information entry [basic information]
2, A, B, C countries for information localization, including Name,description,price and so on. The model is unique and does not need to be localized.
3, D countries found the language and basic information consistent, without localization, at this time read [basic information].
4, E countries can only localize prices, other information according to [basic information] to display.

Add Good_fields table (country_id,good_fields) to determine localized fields
Add a country_goods table (Country_id,goods) to store localized product information

Getting good information requires good_id and country_id
If you feel redundant too much you can consider serializing the Country_goods table to the JSON store

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