"Database Design-3" menu design

Source: Internet
Author: User

SceneWhen we use the database, we often encounter menu options, such as the Personal information table: "Gender": male, female, "education": Junior college, College, undergraduate, master and above; English level: English four, English six, professional eight; These menu options must be maintained in the database, When there are many data tables, the menu options may reach hundreds, so how do you design them? The design method is explained below. (The design method is not unique, I summarize also does not represent the best, for reference only).

Data Sheet DesignA total of 4 tables, respectively, are as follows: 1. 2.3. 4.

Specific Examples1.
If you want to know the "Zhang San" gender and education, you need to go through the following steps (to query SexAs an example): Step 1: Query the table name table Table_name_eng for staff_info corresponding record table_id, in this case table_id=4;Steps2: Find in the Domain name tabletable_id=4 andColumn_name_eng is the menu_id of the sex correspondence record, this example menu_id=16;Steps3: InMenu Content Table Lookupall records of the menu_id=16. 2. The table name table records all table information in the database, one record for each table.
3. The Domain name table records each domain name in each data table. 1 data tables have n fields (columns) that correspond to n records in the table.
4. Menu Contents Table: Record menu contents.




From for notes (Wiz)

"Database Design-3" menu design

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.