E-R model conversion to relational model for Database Design

Source: Internet
Author: User
In the charging system of the Self-reconstructed data center, you need to re-design the database. How can we design the database? This is also an important course "database principles" in our own test. For those who have passed this course, we must have benefited from it and can apply it directly. I took this book in October this year, so I should practice it first. The previous views of Dr. Yan jianling

In the charging system of the Self-reconstructed data center, you need to re-design the database. How can we design the database? This is also an important course "database principles" in our own test. For those who have passed this course, we must have benefited from it and can apply it directly. I took this book in October this year, so I should practice it first. The previous views of Dr. Yan jianling

In the charging system of the Self-reconstructed data center, you need to re-design the database. How can we design the database? This is also an important course "database principles" in our own test. For those who have passed this course, we must have benefited from it and can apply it directly. I took this book in October this year, so I should practice it first.

The previous video from instructor Yan jianling focuses on the specific operations in the database, there is not much to do with the necessary steps in database design, that is, the conversion from the conceptual model to the logical model. Enter the subject:

Background: Data System survival

The entire period from planning, designing, implementing, and maintaining the database application system to being replaced by a new system is called the survival time of the database system. This survival period can generally be divided into seven stages: planning, demand analysis, conceptual design, logical design, Physical Design, Implementation, and operation and maintenance. The transition from today's key concept design to logic design.

Detailed introduction to E-R graph encyclopedia

Build a global conceptual model based on the IDC Charging System

To convert a E-R diagram to a relational model:

Step 1: Convert the three entity types into three modes:

Student (StudentNo, StudentName, sex, academy, major, grade, class)

Card (CardID, Money)

User (UserID, Password, level)

Step 2: For the relation "use", you can add the student ID (the student ID is a foreign key) in "card" mode ). In this way, the first step gets the following three modes:

Student (StudentNo, StudentName, sex, academy, major, grade, class)

Card (CardID, Money,StudntNo)

Step 3: form a new relationship with M: N.

Registe (CardID, studentNO, userID, Note, Date, Time)

CancelCard (CardID, studentNo, CancelCash, date, time, userID, status)

Charge (CardID, studentNo, AddCash, date, time, userID)

Online (CardID, studentNo,OnlineDate, OnlineTime, computer)

Outline (CardID, studentNo, OutelineDate, OutlineTime, concumeTime, concume ,)

The last eight relational modes:

T_student (StudentNo, StudentName, sex, academy, major, grade, class)

T_card (CardID, Money,StudntNo)

T_user (UserID, Password, level)

T_Registe (CardID, studentNO, userID, Note, Date, Time)

T_CancelCard (CardID, studentNo, CancelCash, date, time, userID)

T_Charge (CardID, studentNo, AddCash, date, time, userID)

T_Online (CardID, studentNo,OnlineDate, OnlineTime, computer)

T_Outline (CardID, studentNo, OutelineDate, OutlineTime, concumeTime, concume ,)

The following relational model is designed based on system functions:

T_Worklog (UserID, OnlineDate, OnlineTime, OutelineDate, OutlineTime)

T_Basicdate (Rate, tmpRate, unitTime, leastTime, PrepareTime, limitCash, head, date, time) (the report table to be updated)

This process makes me understand that the tables in the database are not imaginary, and I did not design any fields based on what the system functions need, instead, the entity, link, and attribute are obtained based on the user requirements and feasibility analysis in the planning and demand analysis phases of the database design. Then the table is designed, design a view based on the function when applying system functions. According to the table designed in the above steps, the reduction of coupling is also in line with three paradigms (first paradigm: No further division, second paradigm: preventing local dependence, third paradigm: Eliminating transmit dependencies)

PS: Beginner. If any error occurs, correct it!

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.