[Data room Charging System] Database Design

Source: Internet
Author: User

This article introduces the database design based on the three-paradigm of the data room charging system.

It only meets the basic functional requirements and does not contain additional information for storage.

 

Review

The Design of Relationship patterns directly affects data redundancy and data consistency. Therefore, we have an evaluation indicator. That is, paradigm.

The first paradigm: the attribute values of each link R in the relational model r are atomic values that cannot be divided.

Second paradigm: the relational model R is 1NF and each non-primary attribute fully depends on the candidate key.

Third paradigm: relational model R is 1NF and each non-primary attribute does not pass a candidate key dependent on R

 

ERTU

 

 

Algorithm for converting ergraphs into relational mode Sets

 

Step 1 (object type conversion)

Convert each object type into a relational model. The attributes of an object are the attributes of the relational model, and the object identifier is the key of the relational model.

Then, the basic data table and machine table of the staff table are obtained. Because the machine has only one attribute, it can be combined with other machines.


Step 2 (contact type conversion) perform different processing based on different situations.

Step 2.1 convert binary contact types

1) if the link between entities is, the two object types can be converted into a link mode. The object attributes are the properties of the link mode, and the object identifier is the key of the link mode.

2) if the object contact is 1: N, the object type on the N side is converted to the link mode, and the key of the object type on the 1 side is added as the attribute of the foreign key and the contact type.

3) if the contact between entities is M: N, the contact type is also converted to the relational model. Its attribute is the link type attribute added to the keys of the two object types (as foreign keys), and the key is a combination of two objects.

Instant

 

Step 2.2 convert the contact type of one dollar

It is similar to the conversion of binary contact types.

Step 2.3 (conversion of the ternary contact type)

1) if the ing between entities is, you can convert Multiple object types to attributes of any one or two link modes in three link modes by adding the keys of the other two link modes (as foreign keys) and contact type attributes.

2) If the link between entities is 1: 1: N, then add two keys of the 1-end object type (as the foreign key) to the transformation of the N-end object type to the link mode) and contact type attributes.

3) if the contact between entities is M: N: P, the contact type is also converted to the link mode. Its attribute is the key of the object type (as a foreign key) the link type attribute is added, and the two keys are a combination of three-end object keys.

Therefore

 

 

The above is my personal understanding, and there will be some slight changes in the actual implementation. If you have any questions, please visit us.

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.