Database Design Series [02] Why learning database design?

Source: Internet
Author: User
ArticleDirectory
  • 1. What are the problems caused by poor database design?
  • 2. Example scenario
  • 3. Summary
1. What are the problems caused by poor database design?

In the conceptual design stage of the database, different modelers have different results for modeling in the same field, and the converted relational models are also different. In this way, there are advantages and disadvantages of the relational model. To learn about database design, we need to learn the rules and common representation methods summarized by our predecessors. Before learning how to design, we should first understand the problems caused by poor design.

2. Example scenario

In the procurement scenario, the order number, product information, and operator information must be recorded. If we design it like this

 

There are data redundancy, insertion, update, and deletion exceptions;

2.1 data redundancy

In this application design, ordernum and createname are repeatedly stored. When the order volume is large, this waste will be considerable.

2.2 insertion exception

From the design of this relational mode, we can see that ordernum and goodsname constitute the primary key. When no one buys the product, the product cannot be imported into the database. Obviously, this is unreasonable.

2.3 update exception

If Wang Xiaoji, the Creator, is renamed as Wang Xiaoyi, many lines need to be updated. Or, due to some verification problems, data such as "sanbao" and "sanbao" appears. In terms of semantics, this is the same product, but it cannot be identified from the database, it is a headache when a report is generated.

2.4 deletion exception

If, two years later, the three treasures product was discontinued, we would like to delete the Three Treasures product so that it cannot be purchased again. However, we also deleted a purchase history of 111123. This is also unreasonable.

3. Summary

In general, for the same application field, we can design a good model and a business trip model. So how can we design it to be closer to a good model. We need to follow some design paradigms. What is the design paradigm? Write it again in the next article.

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.