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

Three properties of MySQL database

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

What are the three properties of the MySQL database? In general, people's understanding of MySQL may stay at the conceptual level, while the understanding of the three major attributes of MySQL database is relatively less. Today I'm going to talk to you about the three attributes of MySQL database.

1. Atomicity requires that attributes are atomic and can no longer be decomposed.

Table: field 1, field 2 (field 2.1, field 2.2), field 3.

For example, if a student (student number, name, gender, date of birth) thinks that the last column can be subdivided into (year of birth, month of birth, birthday), it is not a paradigm, otherwise it is.

2. Uniqueness, a table can only show one thing, that is, the uniqueness of an entity.

Table: student number, course number, name, credit

This shows that there are two things: student information and course information; because non-primary key fields must rely on the primary key, where credits depend on the course number, name dependence and student number, it does not conform to the two paradigms.

There may be problems:

Data redundancy: each record contains the same information

Delete exception: delete all student scores and delete all course information

Insert exception: the student did not take a course and cannot record it in the database

Update exception: adjust course credits, all lines are adjusted.

The right thing to do:

Student: Student (student number, name)

Course: Course (course number, credits)

Course selection relationship: StudentCourse (student number, course number, grade).

3. Redundancy, each column is directly related to the primary key, and there is no transitive dependency.

Table: student number, name, age, college name, college telephone number

Because there is dependency delivery: (student number) → (student) → (college) → (college phone).

There may be problems:

Data redundancy: duplicate valu

Update exception: there is duplicate redundant information. When modifying, multiple records need to be modified at the same time, otherwise the data will be inconsistent.

The right thing to do:

Student: (student number, name, age, college)

College: (college, telephone).

The above is the summary of the three major attributes of the MySQL database, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.

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

Database

Wechat

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

12
Report