当前位置:网站首页>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 ;
边栏推荐
- Four common post data submission methods
- Data output - dynamic drawing
- Promise from introduction to mastery (Chapter 2 understanding and use of promise)
- Software testing interview question: what do you think is the key to good test case design?
- C#引入WINAPI传递中文字符串参数字符集问题
- Flex development web page instance web side
- 【愚公系列】2022年07月 Tabby集成终端的使用
- Promise从入门到精通(第4章 async 和 await)
- Aike AI frontier promotion (7.14)
- The principle and implementation of loss function cross entropy
猜你喜欢

Five basic data structures of redis

Flex layout - fixed positioning + flow layout - main axis alignment - side axis alignment - expansion ratio

Go learning 01

Unity 保存图片到相册以及权限管理

测试/开发程序员的级别“陷阱“,级别不是衡量单维度的能力......

Flex布局学习完成PC端

How to evaluate the effectiveness of R & D personnel? Software Engineer reports help you see everyone's contribution

In it, there is a million talent gap, and the salary rises, but it is not capped

The level "trap" of test / development programmers is not a measure of one-dimensional ability

Vxe Table/Grid 单元格分组合并
随机推荐
交叉熵原理及实现
[深入研究4G/5G/6G专题-42]: URLLC-14-《3GPP URLLC相关协议、规范、技术原理深度解读》-8-低延时技术-2-基于slot的调度与Slot内灵活的上下行符号配比
Ceresdao: new endorsement of ventures Dao
The principle and implementation of loss function cross entropy
IT这个岗位,人才缺口百万,薪资水涨船高,上不封顶
Common problem types and methods of mathematical univariate differential proof problems in postgraduate entrance examination
Appium click operation sorting
focal loss原理及实现
Common video resolution
Five basic data structures of redis
Record a production deadlock
Promise from introduction to mastery (Chapter 2 understanding and use of promise)
sftp文件/文件夹上传服务器
C# 使用Abp仓储访问数据库时报错记录集
Codeworks round 810 (Div. 2) a~c problem solution
Leetcode hot topic Hot 100 - > 1. Sum of two numbers
QGIS mapping: vector data mapping process and export
Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)
Likeshop takeout ordering system [100% open source, no encryption]
【数据库数据恢复】SQL Server数据库磁盘空间不足的数据恢复案例