Get the App
SLTechnology News&Howtos  ›  Database  › 

Three properties of MySQL database

Shulou Source: shulou.com Published: 2022-06-01 18:06:25 10月02日 Update

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.

Tags: Data student number course student college name field attribute database information redundancy credit three phone practice atom that is age score Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Technology MySQL vpn MariaDB