In the actual development process, everyone may be directly oriented to the needs, and more about how to implement functions on the existing basis, thus ignoring the importance of database design.
This article will introduce the specific process of database design, such as ER diagram, database paradigm, etc.
- Introduction to the main functions of the brief account
- Brief account backend environment introduction and deployment
- Brief account front-end environment introduction and deployment
- Solve the prompt that the Token cannot be empty when the Mini Program scan code authorization
1. The main steps
Generally speaking, database design is mainly divided into the following steps
The goal of conceptual design is to produce a conceptual structure of a database that reflects the information needs of an enterprise organization, that is, a conceptual model.
The conceptual model is independent of the logical structure of the database, independent of the DBMS (Database Management System) that supports the database, and does not depend on the computer system.
The ER (Entity Connection) model is an abstraction of the real world, and its main components are entities, connections and attributes.
Generally speaking, the conceptual design can be well displayed through the ER diagram. The ER diagram of the role permissions in the
brief account is as follows:
Second, the table design
When it comes to database design would have to say
数据库范式, and in general to comply with the third paradigm.
1NF first normal form condition : must not include the relationship of repeated groups, that is, each column is an inseparable atomic item.
2NF second normal form condition : the relational model must satisfy the first normal form, and all non-primary attributes are completely dependent on the primary code.
3NF The condition of the third normal form : the relational model satisfies the second normal form, and all non-primary attributes have no transitive dependence on any candidate keywords. That is, each attribute has a direct relationship with the primary key rather than an indirect relationship
3NF a little bit difficult to understand, for example:
record details table
tb_detailtable (id, user Id, spend category name, spend category code, amount) is not consistent with such a table structure
3NF. Because the expense category name and expense category code are corresponding, there is a transfer relationship.
The correct design shown should be:
tb_detailtable (id, user Id, expense category Id),
tb_spend_categorytable (id, expense category name, expense category code)
The database table design in the brief account is as follows:
Thank you for seeing the end, I am very honored to be able to help you~♥