How to Design the database structure?

Source: Internet
Author: User
{Code ...} requirements: 1. One person enters [basic information] 2. Country A, Country B, and country C for information localization, including name, description, and price. The model is unique and does not require localization. 3. Country D found that the language and basic information are consistent, so no localization is required. This...
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 |+--------------+------------------------+

Requirements:
1. One person enters the product information. [Basic Information]
2. Country A, Country B, and country C localize information, including name, description, and price. The model is unique and does not require localization.
3. Country D found that the language is consistent with the basic information, and no localization is required. In this case, the [basic information] is read.
4. E countries can only offer localized prices. Other information is displayed in [basic information.

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 |+--------------+------------------------+

Requirements:
1. One person enters the product information. [Basic Information]
2. Country A, Country B, and country C localize information, including name, description, and price. The model is unique and does not require localization.
3. Country D found that the language is consistent with the basic information, and no localization is required. In this case, the [basic information] is read.
4. E countries can only offer localized prices. Other information is displayed in [basic information.

Add the good_fields table (country_id, good_fields) to determine the localization Field
Add a country_goods table (country_id, goods) to store localized product information.

To obtain good information, good_id and country_id are required.
If you think there is too much redundancy, consider serializing the country_goods table to json storage.

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.