Rebuilding the data room charging system-database design and restructuring the data room Charging System

Source: Internet
Author: User

Rebuilding the data room charging system-database design and restructuring the data room Charging System

After completing the three-tier example, Data Center reconstruction should have started for a long time, but I have never wanted to change it. Everything is difficult at the beginning. The reconstruction of data center fees is first a database design problem, start the design of the ergraph. Then design the database and design the table .......

Now think about the design of your own database. First, let's think about the entire process of getting on and off the machine. A student comes to the front of the teacher with a card. The teacher tells the student's card activation. The student is holding the card and goes to the computer. If the student doesn't have a card, teachers can register new cards for students. If there is no money in the cards, they can also recharge the students. If the students do not want to get cards or cancel the cards, the relationship between the students and the cards is the same. Finally, the student is on the machine and then takes the card to ask the teacher to get off the machine. The teacher obtains the data from the basic data table to calculate the student's consumption amount, so that the student can get off the machine. Of course, there is also a table that can record user work records.

Is a self-designed data erdiagram



When the database erdiagram is converted into a relational model, we must follow the three paradigm.

Paradigm 1: every attribute in the relational model cannot be subdivided. For example, a relational model has an address attribute, which can be from China> Hebei province> Langfang City. In this way, the attribute is not single and does not meet the first paradigm.

Second paradigm: After the relational model R satisfies 1NF, each non-primary attribute fully depends on the candidate key. In fact, there is no local dependency. For example, the attributes of R (StudentNO, CourseNO, Score, TeacherNO, and Title) represent the student's student ID, course number, Score, instructor number, and instructor Title respectively. Apparently, the candidate keys are (StudentNO, CourseNO). They can publish all the attribute information in this relational mode. However, in the Candidate Key CourseNO, it can, title), which is called a local dependency of non-primary attributes on the candidate key. In a metaphor, the couple had a good time, but one of them had an affair.

Third paradigm: each non-primary attribute does not pass the candidate key of dependency mode R. The premise is that R meets 1NF and 2NF. For example, in relational mode R, A is the candidate key, A --> B, B --> C, A --> C, and the last one is an example of passing dependencies. In this way, 3NF is not satisfied.

Summary

The reconstruction of the IDC led me to go back and review the data design, the three paradigm of the database, and so on. Looking back, we can see that learning is a repetitive process. Everything is hard at the beginning. Please cheer yourself up !!


Related 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.