当前位置:网站首页>Soft test - database (2) relational model
Soft test - database (2) relational model
2022-07-28 02:19:00 【Caterpillars who want to write programs】
1.1 relational model
1.1.1 Definition
From the user's point of view , The logical structure of data in a relational model is a two-dimensional table , It consists of rows and columns ;
Express entity set with table structure , Use foreign keys ( Outer code ) Indicates the entity simple connection ;
1.1.2 Advantages and disadvantages
advantage :
Based on strict mathematical concepts ;
A single concept , Simple structure 、 Clear 、 It's easy for users to understand and use ;
Access path is transparent to users , So data independence 、 Good safety , Simplify database development ;
shortcoming :
Because the access path is transparent , Query efficiency is often lower than that of non relational data model ;
1.2 Basic concepts
1.2.1 Domain
Is a set of values with the same data type ;
1.2.2 The cartesian product
Two sets X and Y The Cartesian product of , Also called direct product , Expressed as X * Y , The first object is X And the second object is Y One of the members of all possible ordered pairs .
example :X = { a ,b ,c },Y = { 1 , 2 , 3 }
X * Y = {
< a ,1 >,< a ,2 >,< a ,3 >,
< b ,1 >,< b ,2 >,< b ,3 >,
< c ,1 >,< c ,2 >,< c ,3 >,
}
1.2.3 The expression of relationship
Express :
D1 * D2 * …… * Dn A subset of is called in the domain D1,D2,……,Dn Relationship on , Expressed as
R( D1,D2,……,Dn )
R: Relationship name ;
n: The purpose or degree of a relationship ;
Relationships are also a two-dimensional table , Each row of the table corresponds to a tuple , Each column of the table corresponds to a field ;
attribute :
Different columns in a relationship can correspond to the same domain
To make a difference , You have to give each column a name , Called attribute ;
n There must be a relationship between eyes n Attributes ;
Candidate code :
If the value of an attribute group in a relationship can uniquely identify a tuple , The attribute group is called candidate code ;
Main code :
If a relation has more than one candidate code , Select one of the main codes ;

1.2.4 The nature of the basic relationship
The basic relationship has the following 6 Article nature :
1. Columns are homogeneous , That is, the components in each column are the same type of data , From the same domain ;
2. Different columns can come from the same field , Call each of these columns an attribute , Different attributes should be given different attribute names ;
3. The order of the columns doesn't matter , That is, the order of columns can be exchanged arbitrarily ;
4. Any two tuples cannot be exactly the same ;( But in most practical relational database products , for example Oracle , If the user does not define relevant constraints , They both allow two identical tuples in the relational table )
5. The order of the lines doesn't matter , That is, the order of lines can be exchanged arbitrarily ;
6. The component must be atomic , That is, each component must be an indivisible data item ;
1.3 normal form
1.3.1 First normal form
If the relationship pattern R Every relationship r Are inseparable atomic values , So called R It is the mode of the first paradigm ,r Is a normalized relationship ;
In any relational database , The first paradigm is the basic requirement of relational model , Not satisfied with the first paradigm ( 1NF ) Is not a relational database ;
1.3.2 Second normal form
If the relational pattern R yes 1NF, And each non primary attribute is completely functionally dependent on candidate keys , So called R yes 2NF Pattern ;
1.3.3 Third normal form
If the relationship pattern R yes 1NF , And each non primary attribute does not pass dependent on R The candidate code for , said R yes 3NF ;
1.3.4 BC normal form
If the relational pattern R yes 1NF , And each attribute is not passed since R Candidate key for , So called R yes BCNF Pattern ;
边栏推荐
- Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
- 实际工作中,我是如何使用 Postman 做接口测试?
- 每条你收藏的资讯背后,都离不开TA
- 小程序毕设作品之微信校园浴室预约小程序毕业设计成品(3)后台功能
- [机缘参悟-53]:阳谋立身,阴谋防身
- Traversal and properties of binary trees
- Unittest unit test framework full stack knowledge
- LeetCode 热题 HOT 100 -> 3. 无重复字符的最长子串
- 54: Chapter 5: develop admin management services: 7: face warehousing process; Face login process; The browser turns on the video debugging mode (so that the camera can also be turned on in the case o
- 小程序毕设作品之微信校园浴室预约小程序毕业设计成品(1)开发概要
猜你喜欢

Flex layout learning completed on PC side

Two ways for wechat applet to realize dynamic horizontal step bar

Product interpretation - Design and distributed expansion of metersphere UI test module

Codeforces Round #810 (Div. 2)A~C题解

小程序毕设作品之微信校园浴室预约小程序毕业设计成品(3)后台功能
![53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b](/img/9a/674308c7a21fa2be0943ca7967e274.png)
53: Chapter 5: develop admin management service: 6: develop [admin administrator exit login, interface]; (one point: when we want to modify a value with a certain coding method, the new value should b

记录一次生产死锁

MPLS tunnel experiment

探究flex-basis

Flex布局—固定定位+流式布局—主轴对齐—侧轴对齐—伸缩比
随机推荐
Xiaomi website homepage big module - small module + navigation (floating case)
Sample imbalance - entry 0
Common problem types and methods of mathematical univariate differential proof problems in postgraduate entrance examination
Data output - image annotation and annotation
How to put app on the app store?
Go learn 02 basic knowledge
轻量版项目管理系统
In it, there is a million talent gap, and the salary rises, but it is not capped
Unittest单元测试框架全栈知识
交叉熵原理及实现
都在说DevOps,你真正了解它吗?
C# 使用Abp仓储访问数据库时报错记录集
软工必备知识点
实际工作中,我是如何使用 Postman 做接口测试?
Day6 函数和模块的使用
LeetCode 热题 HOT 100 -> 2.两数相加
Promise from introduction to mastery (Chapter 4 async and await)
Implementation of mongodb/mongotemplate.upsert batch inserting update data
埃睿迪再度亮相数字中国峰会 持续深化用科技守护绿水青山
The principle and implementation of loss function cross entropy