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