Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A case study of Database Design on the Road of DBA

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Here, I quote a teacher's case to explain to you, and I hope you can read the previous two articles before reading this article, otherwise you will be confused: linuxclub.info/category/%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AE%A1%E7%90%86/

Teaching Management 1. Basic Needs

A school design student teaching management system, student entity includes student number, name, sex, birthday, family name, native place, resume, enrollment date, each student chooses a major, major includes professional number and name, category, a major belongs to a college, a college can have several majors, college information to store college number, college name, dean, teaching management but also to manage curriculum and student scores. The curriculum includes course number, course name and credit. Each course is offered by a college. Students receive one grade for each course they take.

The ER model of teaching management is designed and transformed into a relational model.

Entity Relationship ER model meaning, we first extract entity information from the requirements

Entity: Student Professional College Courses

2. Next we analyze the attributes of entity records

Entity table attributes to record:

Student (student ID, name, sex, birthday, native place, family name, resume, date of admission)

Specialty (Specialty Number, Specialty, Category)

Faculty (Faculty Number, Faculty Name, Dean)

Course (course number, course name, credit)

3. Entity Relationship

The relational model transformed by the ER model is: here the blue word is especially important and finally add the field association

Student (student number, name, sex, birthday, native place, family name, resume, date of admission, major number)

Major (Major Number, Major, Category, College Number)

Faculty (Faculty Number, Faculty Name, Dean)

Course (course number, course name, credit, college number)

relational table many-to-many

Grades (Student ID, Course ID, Grade, Time, Place)

Conversion rules for relationships between entities

(1) A 1:1 relationship can be transformed into a separate relational pattern or merged with a relational pattern corresponding to either end.

(2) A 1:n relationship can be transformed into an independent relational pattern or merged with the relational pattern corresponding to the n terminal.

(3) An m:n relationship is transformed into a relational pattern. The conversion method is that the codes of entities connected with the relationship and the attributes of the relationship itself are converted into attributes of the relationship, and the code of the new relationship is the combination of two connected entity codes.

(4) Multiple relationships between three or more entities are transformed into a relational pattern.

From the beginning to here is an arrangement that shows the transformation from entity to relationship with ER diagram. So far, this database design is basically such a routine. Of course, a lot of content can be added later. For example, one-to-many relationship conversion and many-to-many relationship conversion. Below, due to my limited energy and going to work, I will directly map it for everyone to see and understand. In this explanation, in fact, database administrators and operation and maintenance personnel only need to know the previous knowledge is enough ha!

I hope you can make progress after reading it, and it will help you. Welcome to increase your face cat learning exchange: QQ: 203833507, pay attention to my public number. There are more articles to share.

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.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report