Bejavagod-How to use data dictionary to classify and unify operations correctly (i)

Source: Internet
Author: User

First talk about what is a data dictionary, this thing is not very likely to explain, give a chestnut bar ~

Each system will have a user table, Gender: male (1) female (0)

In addition, we do logistics will be related to the model: truck (1), Sedan (2), Trailer (3)

Cargo Type: Dangerous Goods (1), General cargo (2), Liquid goods (3)

These are the data dictionary, in peacetime table design, we will separate them as a table to store, and to the future maintenance, query when the association can, but this will have a certain disadvantage, in the dictionary Class A lot of time, there will be a lot of tables, and appear redundant, is not necessary

So today we're going to talk about how to optimize him and reduce the table, then we need a data dictionary.

Let's take a look at the table design:

The following are the DDL:

What is the function of the data dictionary, I summarize the following points

1, in the entire system of all data types play a role in the bridge, the development process, dynamic maintenance system data type

2, to ensure that data entry more secure, business tables using data dictionary, the data type of storage is a key, rather than the specific value, and ultimately saved in the form of cache, in front of the query can be more excellent

3, convenient in the background statistics and view, and maintenance

The following points should be noted when designing a table:

1, data type, data key value pair, all values cannot be empty

2, the data type is consistent, the data keys and values can not be duplicated, must be unique, this additional time needs to be verified

3, data keys to use int easier to sort, of course, you can also use string, this random

Finally take a look at the data content bar, the table for the corresponding additions and deletions, you can achieve the classification of data dictionary management

Bejavagod-How to use data dictionary to classify and unify operations correctly (i)

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.