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

What are the three paradigms of database

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

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the three paradigms of database". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. let's follow the editor's train of thought to study and learn "what is the three paradigms of database"!

There is a lot of talk in the book, which boils down to three sentences:

1NF: fields cannot be divided

2NF: there is a primary key, and non-primary key fields depend on the primary key

3NF: non-primary key fields cannot depend on each other

Explanation:

1NF: atomic fields can no longer be divided, otherwise they are not relational databases

2NF: uniqueness A table shows only one thing

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

Examples that do not conform to the first normal form (create does not produce such tables in relational databases):

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

The problem: because you can't design such a table, there's no problem.

Examples that do not conform to the second paradigm:

Table: student number, name, age, course name, grades, credits

This shows two things: student information and course information.

There is a problem:

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.

Fix:

Student: Student (student number, name, age)

Course: Course (course name, credits)

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

Satisfying the second normal form only eliminates the insertion exception.

Examples that do not conform to the third paradigm:

Student number, name, age, college, college contact number, keyword is a single keyword "student number"

Existence dependency transfer: (student number) → (college) → (college location, college telephone number)

There is a problem:

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.

Delete exception

Fix:

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

College: (college, location, telephone).

Author: sunxing007

Thank you for your reading. the above is the content of "what is the three paradigms of the database". After the study of this article, I believe you have a deeper understanding of what is the three paradigms of the database. The specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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