In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the three paradigms of mysql database design". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the three paradigms of mysql database design?"
First, the knowledge related to the three paradigms of database design. 1. What is the design paradigm?
According to the design basis of the table, the table designed according to these three paradigms will not have data redundancy.
2. Why learn the three paradigms of the database?
The design paradigm of the database is the specification that the database design needs to meet. The database that meets these specifications is concise and the structure is clear. At the same time, there are no insert, delete and update operation exceptions. On the contrary, it is a mess, which not only creates trouble for database programmers, but also looks hideous and may store a lot of unwanted redundant information.
Although we data analysts do not need to design the database ourselves, it is helpful for us to understand the tables later by understanding the three paradigms of the database.
2. What are the three paradigms? 1) the first normal form: any table should have a primary key, and the atomicity of each field can no longer be separated. 2) the second normal form: based on the first paradigm, all non-primary key fields are required to rely entirely on the primary key and cannot produce partial dependencies.
Solution: many-to-many, three tables, two foreign keys in relational tables.
3) the third normal form: based on the second normal form, all non-primary key fields directly rely on the primary key and can not produce transitive dependency.
Solution: one-to-many, two tables, multiple tables plus foreign keys.
Note: remember the two sentences in the blue part above.
Reminder: in the actual development, mainly to meet the needs of customers, and sometimes take redundancy for implementation speed.
Second, the classic design of database tables. 1. How to design one-to-one?
The first scheme: primary key sharing
The second scheme: foreign keys are unique
Note: this is the only case of foreign keys, which is a bit like the many-to-many situation described above, when a unique constraint is added to the foreign key field, it becomes one-to-one.
At this point, I believe you have a deeper understanding of "what is the three paradigms of mysql database design". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.