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

Elaborate on the three paradigms of database

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

Share

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

1NF: fields cannot be divided

Example:

Table 1,

User ID name area 1 Xiaoming Guangzhou City, Guangdong Province 2 Xiaohong Nanjing City, Jiangsu Province can be divided into: province and city

As follows:

Table 2,

User ID name province city 1 Xiaoming Guangdong Province Guangzhou City 2 Xiaohong Nanjing City, Jiangsu Province Table 1 does not conform to the first paradigm, Table 2 accords with

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

Student table (where the student number is the primary key):

Class 001 Xiaojiang Grade 6 Class 1 it is obvious that the class does not depend on people, so this table does not conform to the second paradigm.

The relationship between the student table and the class is in line with the second paradigm when put into a relationship table.

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

Course schedule (course number is the primary key)

Course number, course name, student number, name 1 Chinese 001 Xiaojiang

Among them, the name Xiao Jiang depends on the serial number 001, so it does not satisfy the third paradigm.

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